Answer the question
In order to leave comments, you need to log in
Python. Keyboard input?
Let's say we have this code:
def func1():
print("Func 1")
def func2():
print("Func 2")
def func3():
print("FUnc 3")
command = input("-->")
if command == "1":
func1()
elif command == "2":
func2()
elif command == "3":
func3()
elif command == "exit":
exit()
else:
print("Ошибка. Введите команду еще раз!")
Answer the question
In order to leave comments, you need to log in
while command != 'exit' :
command = input("Введите команду ")
//что-то происходит в зависимости от команды
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question