You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
name_prompt="\nWhat's your name? "place_prompt="If you could visit one place in the world, where would it be? "continue_prompt="\nWould you like to let someone else respond? (yes/no) "responses= {}
whileTrue:
name=input(name_prompt)
place=input(place_prompt)
responses[name] =placerepeat=input(continue_prompt)
ifrepeat!='yes':
breakprint("\n--- Results ---")
forname, placeinresponses.items():
print(name.title() +" would like to visit "+place.title() +".")
报错信息
$ python -u 7-10.py
What's your name? z
Traceback (most recent call last):
File "7-10.py", line 8, in <module>
name = input(name_prompt)
File "<string>", line 1, in <module>
NameError: name 'z' is not defined
The text was updated successfully, but these errors were encountered:
运行7-10程序:
报错信息
The text was updated successfully, but these errors were encountered: