Answer the question
In order to leave comments, you need to log in
I am writing an address book. The function below should change the address and then terminate the while loop. But why doesn't the break statement work?
def change():
while True:
ch = input('\tВведите имя контакта чей адресс вы хотите изменить:\n')
if ch == '':
print('вы ничего не ввели')
for c, v in ab.items():
if c == ch:
new_address = input('Введите новый адресс:\n')
ab[c] = new_address
print('Адресс успешно изменен')
break
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question