Я пытаюсь провести очень базовую c мини-викторину, но постоянно сталкиваюсь с проблемой, когда выполняется только мое выражение else, и я не уверен, почему?
userSleep = [input("Please enter 1 or 2 to answer the question. ")]
if userSleep == 2:
print("Thank you for your answer")
time.sleep(1)
print("What would you say stops you from getting more sleep?")
print("[1.] Social Media")
time.sleep(.25)
print("[2.] On-demand TV services (i.e Netflix, Crunchyroll, YouTube etc.)")
time.sleep(.25)
print("[3.] Medically diagnosed insomnia")
time.sleep(.25)
print("[4.] School assignments/coursework")
time.sleep(.25)
print("[5.] Other")
time.sleep(.5)
userHabits = [input("Please enter a number corresponding one of the options above to answer the question. ")]
print("Thank you for your answer")
time.sleep(1)
break
clear()
elif userSleep == 1:
print("Thank you for your answer")
time.sleep(1)
break
clear()
else:
print("Please input either a 1 or 2")```
I'm using Python 2.7