Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dict_phonebook = {}
- entry_list = []
- while True:
- string_input = input()
- entry_list = string_input.split()
- name = entry_list[0]
- if name == "Over":
- break
- phone = entry_list[2]
- if ord(name[0]) >= 48 and ord(name[0]) <= 57:
- name = entry_list[2]
- phone = entry_list[0]
- dict_phonebook[name] = phone
- for name, phone in sorted(dict_phonebook.items()):
- print(f"{name} -> {phone}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement