diff --git a/loesungen/dictionaries.py b/loesungen/dictionaries.py index c3d7a6c..c5a4d12 100644 --- a/loesungen/dictionaries.py +++ b/loesungen/dictionaries.py @@ -68,7 +68,16 @@ print("-" * 50) # Aufgabe 5 & 6 mit Funktion def print_salary_list(data, col_width=8): - heading = "Name".ljust(col_width) + "Gehalt" + """Print a formatted list of employees and their salary. + + Expects a a dictionary as the first argument: + + { + "name": salary, + ... + } + """ + heading = "Name".ljust(col_width) + " Gehalt" print(heading) print("-" * len(heading)) for name, salary in data.items(): @@ -76,7 +85,7 @@ def print_salary_list(data, col_width=8): print_salary_list(salaries_new, 10) print("-" * 50) -print_salary_list(salaries_all, 10) +print_salary_list(salaries_all, col_width=10) print("-" * 50)