Я создаю область выбора главы, и каждый ввод ведет к первой главе/началу2. Я не знаю, что делаю не так.
Я думаю, что основная проблема связана с функциями def и start. Когда я перехожу к вводу главы 2, главы 2 или главы 2, я получаю главу 1 (start2) вместо главы 2 (chapter2).
Я написал это в веб-редакторе Python, поэтому проблема может быть в программе, мне все равно придется протестировать ее в PyCharm.
import os
import sys
import random
import time
RED = "\033[31m"
BLACK = "\033[30m"
RESET = "\033[0m"
def start2():
name = input("What is your name? ")
if name == "skip":
name = "Gil"
os.system("printf '\033c'")
start1()
os.system("printf '\033c'")
print("Hello " + name)
time.sleep(2)
os.system("printf '\033c'")
print("I have a few questions for you before we begin. ")
time.sleep(2)
os.system("printf '\033c'")
day = input("How is your day going? good/bad ")
time.sleep(2)
if day == "good":
print("That's good. ")
time.sleep(2)
os.system("printf '\033c'")
if day == "bad":
print("Awh, hope it gets better. ")
time.sleep(2)
pronoun = input("What are your preferred pronouns (ex. he,she,they)")
pronoun2 = input("and secondary? (ex. his,her,their)")
os.system("printf '\033c'")
print("Anyways, next question ")
time.sleep(3)
os.system("printf '\033c'")
print("W")
time.sleep(.5)
os.system("printf '\033c'")
print("Wh")
time.sleep(.5)
os.system("printf '\033c'")
print("Who")
time.sleep(.5)
os.system("printf '\033c'")
print("Who ")
time.sleep(.5)
os.system("printf '\033c'")
print("Who a")
time.sleep(.5)
os.system("printf '\033c'")
print("Who ar")
time.sleep(.5)
os.system("printf '\033c'")
print("Who are")
time.sleep(.5)
os.system("printf '\033c'")
print("Who are ")
time.sleep(.5)
os.system("printf '\033c'")
print("Who are y")
time.sleep(.5)
os.system("printf '\033c'")
print("Who are yo")
time.sleep(.5)
os.system("printf '\033c'")
print("Who are yo")
time.sleep(.5)
os.system("printf '\033c'")
for i in range(50):
print(RED + "Who are you" + RESET + RED + "Who are you" + RESET + RED + "Who are you" + RESET + RED + "Who are you" + RESET + RED + "Who are you" + RESET + RED + "Who are you" + RESET + RED + "Who are you" + RESET + RED + "Who are you" + RESET + RED + "Who are you" + RESET + RED + "Who are you" + RESET)
time.sleep(1)
os.system("printf '\033c'")
print("sorry about that. ")
time.sleep(2)
os.system("printf '\033c'")
print("rebooting")
time.sleep(1)
os.system("printf '\033c'")
print("rebooting.")
time.sleep(1)
os.system("printf '\033c'")
print("rebooting..")
time.sleep(1)
os.system("printf '\033c'")
print("rebooting...")
time.sleep(1)
os.system("printf '\033c'")
input("[START]")
time.sleep(1)
print("They didn't know where it came from.")
input(">")
os.system("printf '\033c'")
print("or even what it was")
input(">")
os.system("printf '\033c'")
print(RED + "it burrowed deeper" + RESET)
input(">")
os.system("printf '\033c'")
print("Their head was " + RED + "throbbing." + RESET )
time.sleep(1)
os.system("printf '\033c'")
print("Their head was throbbing.")
time.sleep(1)
os.system("printf '\033c'")
print("Their head was " + RED + "throbbing." + RESET )
input(" ent to continue ")
os.system("printf '\033c'")
print("Their vision blurred. ")
input(">")
os.system("printf '\033c'")
print("They slumped over")
input("Move?")
print(RED + "cant"+ RESET)
input(">")
print(RED + "You took control"+ RESET)
time.sleep(.1)
os.system("printf '\033c'")
print("It took control")
os.system("printf '\033c'")
input(">")
os.system("printf '\033c'")
time.sleep(3)
print(name + " woke up on the side of a highway")
input(">")
os.system("printf '\033c'")
print(RED + "It was a success. "+ RESET)
input(">")
os.system("printf '\033c'")
print(RED + "FIND THEM" + RESET)
input(">")
os.system("printf '\033c'")
print(" | - | ")
time.sleep(.5)
print(" | | ")
time.sleep(.5)
print(" | - | ")
time.sleep(.5)
print(" O | | Up/Down ")
time.sleep(.5)
print(" | - | ")
time.sleep(.5)
print(" | | ")
time.sleep(.5)
print(" | - | ")
time.sleep(.5)
print(" | | ")
time.sleep(2)
updown = input(">")
if updown == "down" or "Down":
os.system("printf '\033c'")
print(" | - | ")
print(" | | ")
print(" | - | ")
print(" | | ")
print(" O | - | ")
print(" | | ")
print(" | - | ")
print(" | | ")
time.sleep(2)
os.system("printf '\033c'")
print(" | - | ")
print(" | | ")
print(" | - | ")
print(" | | ")
print(" | - | ")
print(" O | | ")
print(" | - | ")
print(" | | ")
time.sleep(2)
os.system("printf '\033c'")
print(" | - | ")
print(" | | ")
print(" | - | ")
print(" | | ")
print(" | - | ")
print(" | | ")
print(" O | - | ")
print(" | | ")
time.sleep(2)
os.system("printf '\033c'")
print(" | - | ")
print(" | | ")
print(" | - | ")
print(" | | ")
print(" | - | ")
print(" | | ")
print(" | - | ")
print(" O | | ")
time.sleep(2)
os.system("printf '\033c'")
print(" | - | ")
print(" | | ")
print(" | - | ")
print(" | | ")
print(" | - | ")
print(" | | ")
print(" | - | ")
print(" | | ")
time.sleep(2)
os.system("printf '\033c'")
elif updown == "up" or "Up":
os.system("printf '\033c'")
print(" | - | ")
print(" | | ")
print(" O | - | ")
print(" | | ")
print(" | - | ")
print(" | | ")
print(" | - | ")
print(" | | ")
time.sleep(2)
os.system("printf '\033c'")
print(" | - | ")
print(" O | | ")
print(" | - | ")
print(" | | ")
print(" | - | ")
print(" | | ")
print(" | - | ")
print(" | | ")
time.sleep(2)
os.system("printf '\033c'")
print(" O | - | ")
print(" | | ")
print(" | - | ")
print(" | | ")
print(" | - | ")
print(" | | ")
print(" | - | ")
print(" | | ")
time.sleep(2)
os.system("printf '\033c'")
chapter2()
else:
print("input(null)")
exit
def chapter2():
print(" CHAPTER 2 ")
print(" Where did you go? (up/down)")
updown = input("
Подробнее здесь: https://stackoverflow.com/questions/798 ... upon-input
Запуск start2 вместо Chapter2 при вводе? [дубликат] ⇐ Python
Программы на Python
-
Anonymous
1770223903
Anonymous
Я создаю область выбора главы, и каждый ввод ведет к первой главе/началу2. Я не знаю, что делаю не так.
Я думаю, что основная проблема связана с функциями def и start. Когда я перехожу к вводу главы 2, главы 2 или главы 2, я получаю главу 1 (start2) вместо главы 2 (chapter2).
Я написал это в веб-редакторе Python, поэтому проблема может быть в программе, мне все равно придется протестировать ее в PyCharm.
import os
import sys
import random
import time
RED = "\033[31m"
BLACK = "\033[30m"
RESET = "\033[0m"
def start2():
name = input("What is your name? ")
if name == "skip":
name = "Gil"
os.system("printf '\033c'")
start1()
os.system("printf '\033c'")
print("Hello " + name)
time.sleep(2)
os.system("printf '\033c'")
print("I have a few questions for you before we begin. ")
time.sleep(2)
os.system("printf '\033c'")
day = input("How is your day going? good/bad ")
time.sleep(2)
if day == "good":
print("That's good. ")
time.sleep(2)
os.system("printf '\033c'")
if day == "bad":
print("Awh, hope it gets better. ")
time.sleep(2)
pronoun = input("What are your preferred pronouns (ex. he,she,they)")
pronoun2 = input("and secondary? (ex. his,her,their)")
os.system("printf '\033c'")
print("Anyways, next question ")
time.sleep(3)
os.system("printf '\033c'")
print("W")
time.sleep(.5)
os.system("printf '\033c'")
print("Wh")
time.sleep(.5)
os.system("printf '\033c'")
print("Who")
time.sleep(.5)
os.system("printf '\033c'")
print("Who ")
time.sleep(.5)
os.system("printf '\033c'")
print("Who a")
time.sleep(.5)
os.system("printf '\033c'")
print("Who ar")
time.sleep(.5)
os.system("printf '\033c'")
print("Who are")
time.sleep(.5)
os.system("printf '\033c'")
print("Who are ")
time.sleep(.5)
os.system("printf '\033c'")
print("Who are y")
time.sleep(.5)
os.system("printf '\033c'")
print("Who are yo")
time.sleep(.5)
os.system("printf '\033c'")
print("Who are yo")
time.sleep(.5)
os.system("printf '\033c'")
for i in range(50):
print(RED + "Who are you" + RESET + RED + "Who are you" + RESET + RED + "Who are you" + RESET + RED + "Who are you" + RESET + RED + "Who are you" + RESET + RED + "Who are you" + RESET + RED + "Who are you" + RESET + RED + "Who are you" + RESET + RED + "Who are you" + RESET + RED + "Who are you" + RESET)
time.sleep(1)
os.system("printf '\033c'")
print("sorry about that. ")
time.sleep(2)
os.system("printf '\033c'")
print("rebooting")
time.sleep(1)
os.system("printf '\033c'")
print("rebooting.")
time.sleep(1)
os.system("printf '\033c'")
print("rebooting..")
time.sleep(1)
os.system("printf '\033c'")
print("rebooting...")
time.sleep(1)
os.system("printf '\033c'")
input("[START]")
time.sleep(1)
print("They didn't know where it came from.")
input(">")
os.system("printf '\033c'")
print("or even what it was")
input(">")
os.system("printf '\033c'")
print(RED + "it burrowed deeper" + RESET)
input(">")
os.system("printf '\033c'")
print("Their head was " + RED + "throbbing." + RESET )
time.sleep(1)
os.system("printf '\033c'")
print("Their head was throbbing.")
time.sleep(1)
os.system("printf '\033c'")
print("Their head was " + RED + "throbbing." + RESET )
input(" ent to continue ")
os.system("printf '\033c'")
print("Their vision blurred. ")
input(">")
os.system("printf '\033c'")
print("They slumped over")
input("Move?")
print(RED + "cant"+ RESET)
input(">")
print(RED + "You took control"+ RESET)
time.sleep(.1)
os.system("printf '\033c'")
print("It took control")
os.system("printf '\033c'")
input(">")
os.system("printf '\033c'")
time.sleep(3)
print(name + " woke up on the side of a highway")
input(">")
os.system("printf '\033c'")
print(RED + "It was a success. "+ RESET)
input(">")
os.system("printf '\033c'")
print(RED + "FIND THEM" + RESET)
input(">")
os.system("printf '\033c'")
print(" | - | ")
time.sleep(.5)
print(" | | ")
time.sleep(.5)
print(" | - | ")
time.sleep(.5)
print(" O | | Up/Down ")
time.sleep(.5)
print(" | - | ")
time.sleep(.5)
print(" | | ")
time.sleep(.5)
print(" | - | ")
time.sleep(.5)
print(" | | ")
time.sleep(2)
updown = input(">")
if updown == "down" or "Down":
os.system("printf '\033c'")
print(" | - | ")
print(" | | ")
print(" | - | ")
print(" | | ")
print(" O | - | ")
print(" | | ")
print(" | - | ")
print(" | | ")
time.sleep(2)
os.system("printf '\033c'")
print(" | - | ")
print(" | | ")
print(" | - | ")
print(" | | ")
print(" | - | ")
print(" O | | ")
print(" | - | ")
print(" | | ")
time.sleep(2)
os.system("printf '\033c'")
print(" | - | ")
print(" | | ")
print(" | - | ")
print(" | | ")
print(" | - | ")
print(" | | ")
print(" O | - | ")
print(" | | ")
time.sleep(2)
os.system("printf '\033c'")
print(" | - | ")
print(" | | ")
print(" | - | ")
print(" | | ")
print(" | - | ")
print(" | | ")
print(" | - | ")
print(" O | | ")
time.sleep(2)
os.system("printf '\033c'")
print(" | - | ")
print(" | | ")
print(" | - | ")
print(" | | ")
print(" | - | ")
print(" | | ")
print(" | - | ")
print(" | | ")
time.sleep(2)
os.system("printf '\033c'")
elif updown == "up" or "Up":
os.system("printf '\033c'")
print(" | - | ")
print(" | | ")
print(" O | - | ")
print(" | | ")
print(" | - | ")
print(" | | ")
print(" | - | ")
print(" | | ")
time.sleep(2)
os.system("printf '\033c'")
print(" | - | ")
print(" O | | ")
print(" | - | ")
print(" | | ")
print(" | - | ")
print(" | | ")
print(" | - | ")
print(" | | ")
time.sleep(2)
os.system("printf '\033c'")
print(" O | - | ")
print(" | | ")
print(" | - | ")
print(" | | ")
print(" | - | ")
print(" | | ")
print(" | - | ")
print(" | | ")
time.sleep(2)
os.system("printf '\033c'")
chapter2()
else:
print("input(null)")
exit
def chapter2():
print(" CHAPTER 2 ")
print(" Where did you go? (up/down)")
updown = input("
Подробнее здесь: [url]https://stackoverflow.com/questions/79882932/running-start2-instead-of-chapter2-upon-input[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия