Вопрос: В чем проблема, если python продолжает повторять один и тот же ввод снова и снова и не будет продвигаться до конца программы?Python не будет продвигаться
Where do you want to go? X
And how many days will you be staying in X? 1
And how many days will you be staying in X? 2
And how many days will you be staying in X? 164
And how many days will you be staying in X? 59
...
Вот соответствующая часть кода:
# Import modules
import destinations
import currency
save_itinerary = True
main_function = True
while (main_function):
# Determine length of stay
while True:
try:
length_of_stay = int(input("And how many days will you be staying in " + destinations.destination[0] + "? "))
# Check for non-positive input
if (length_of_stay <= 0):
print("Please enter a positive number of days.")
continue
except ValueError:
print("The value you entered is invalid. Only numerical values are valid.")
break
else:
break
Трудно догадаться без кода, но с верхней части моей головы я бы проверил ваши условия завершения цикла. – seaotternerd
Опубликовать этот раздел кода. – erip
[program] (http://pastebin.com/CXH3pH3z) Я получу две другие программы за минуту – sithlorddahlia