#!/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()