You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

30 lines
911 B

#!/usr/bin/env python3
#title :8-5.py
#description :Opdracht 8.5 - Dict & functions
#author :Marcel Haazen
#email :marcel@haazen.xyz
#date :04-11-2019 - 10:10
#version :0.1
#usage :python3 8-5.py
#notes :
#python_version :3.7.3
#==============================================================================
def namen():
namen = {}
while True:
naam = str(input("Volgende naam: "))
if naam == "":
for name in namen.keys():
if namen[name] == 1:
print("Er is", namen[name], "student met de naam", name)
else:
print("Er zijn", namen[name], "studenten met de naam", name)
break
else:
if naam in namen.keys():
namen[naam] = namen[naam]+1
else:
namen[naam] = 1
namen()