Буду признателен за любую помощь. Раньше я программировал на Python, но я определенно не эксперт. Все еще работаем над основами
Код
Код, часть 2
Код: Выделить всё
"""python
def main():
x = 0
while True:
try:
if x == 0:
register_answer = input("Would you like to register to vote? (y/n): ")
if register_answer == "y":
x += 1
elif register_answer.lower() == "n":
print("Closing Application")
break
if x == 1:
citizenship = input("Are you a U.S. Citizen? (y/n): ")
if citizenship == "y":
x += 1
else:
print("Sorry, you must be a U.S. Citizen to vote.\nClosing Application")
break
if x == 2:
age = int(input("How old are you? "))
if age >= 18 and age
Подробнее здесь: [url]https://stackoverflow.com/questions/78487953/exception-block-not-catching-errors[/url]