Exercise 3

Due to the string type in the text, when conducting the input function I have to set the type to string in advance, or ‘TypeError’ would show up; Also, the start number of my search has to be updated or the loop would never end.
Exercise 4


Because it’s a nested dictionary, the first thing is to extract zip info from each city, and then retrieve the zip code values from the sub-dictionary.
![]()


The default type of input is set to be string, so I have to add an integer function outside, and set a foolproof mechanism to avoiding breaking the loop without getting an appropriate value.