30-Days-Of-Python icon indicating copy to clipboard operation
30-Days-Of-Python copied to clipboard

Update 17_exception_handling.md

Open AdityaDanturthi opened this issue 3 years ago • 0 comments

f missing in f-string in first example of packing dictionaries

Section: Packing dictionaries

Proposed change: def packing_person_info(**kwargs): # Printing dictionary items for key in kwargs:

    print(`f`"{key} = {kwargs[key]}")      # This is the line to be updated
return kwargs

print(packing_person_info(name="Asabeneh", country="Finland", city="Helsinki", age=250))

What's missing: print(f"{key} = {kwargs[key]}")

Reason: If we don't include f before the string it won't print the key-value pairs.

AdityaDanturthi avatar Aug 19 '22 13:08 AdityaDanturthi