Я понимаю, что это на первый взгляд просто, я новичок, прошу прощения, если зря потратил чье-то время, но я совершенно растерялся, вот мой код
print ("you awaken in a dark room")
print ("you look to your left, a sword is placed next to your side")
print ("do you pick up the sword?")
choice = input("> ").lower()
if choice == "yes":
print ("You pick up the sword")
print ("With sword in hand you walk down the tunnel, you are confronted with the choice of turning left or right")
choice = input("> ").lower()
if choice == "left":
print ("you turn left and face a goblin")
print ("Do you attack?")
choice = input("> ").lower()
if choice == "yes":
print ("You attack the goblin and the goblin dies by your blade ")
elif choice == "no":
print ("the goblin strikes your torso, causing a large gash. This weakens you")
elif choice == 'right':
choice = input('> ').lower
print ("you reach a cavern with a shield, do you pick it up?")
if choice == 'yes':
print ("you pick up the shield, its weight comfortable on your arm and you prepare yourself for the journey ahead")
elif choice == 'No':
print ('you ignore the shield and carry on your voyage')
Подробнее здесь: https://stackoverflow.com/questions/798 ... nput-right
Может ли кто-нибудь помочь мне не завершать работу кода всякий раз, когда я ввожу «правильно» [закрыто] ⇐ Python
Программы на Python
1772458376
Anonymous
Я понимаю, что это на первый взгляд просто, я новичок, прошу прощения, если зря потратил чье-то время, но я совершенно растерялся, вот мой код
print ("you awaken in a dark room")
print ("you look to your left, a sword is placed next to your side")
print ("do you pick up the sword?")
choice = input("> ").lower()
if choice == "yes":
print ("You pick up the sword")
print ("With sword in hand you walk down the tunnel, you are confronted with the choice of turning left or right")
choice = input("> ").lower()
if choice == "left":
print ("you turn left and face a goblin")
print ("Do you attack?")
choice = input("> ").lower()
if choice == "yes":
print ("You attack the goblin and the goblin dies by your blade ")
elif choice == "no":
print ("the goblin strikes your torso, causing a large gash. This weakens you")
elif choice == 'right':
choice = input('> ').lower
print ("you reach a cavern with a shield, do you pick it up?")
if choice == 'yes':
print ("you pick up the shield, its weight comfortable on your arm and you prepare yourself for the journey ahead")
elif choice == 'No':
print ('you ignore the shield and carry on your voyage')
Подробнее здесь: [url]https://stackoverflow.com/questions/79898684/can-someone-help-me-not-make-the-code-terminate-whenever-i-input-right[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия