사용자 입력이 통과 된 후 input.check 함수에서 허용되는 입력이 인쇄 메시지에 의해 확인 된 다음 다른 함수를 실행해야합니다. 그러나 그렇게하지 않으면 그림이 표시되지 않습니다. 왜 그런지 - 문제를 해결하는 방법에 대해 조언을 해 줄 수 있습니까? 많은 감사합니다!사용자 입력 파이썬 확인하기
def main():
print('WELCOME TO THE WULFULGASTER ENCRYPTOR 9000')
print('==========================================')
print('Choose an option...')
print('1. Enter text to Encrypt')
print('2. Encrypt text entered')
print('3. Display Encrypted Text!')
menuChoice()
def menuChoice():
valid = ['1','2','3']
userChoice = str(input('What Would You Like To Do? '))
if userChoice in valid:
inputCheck(userChoice)
else:
print('Sorry But You Didnt Choose an available option... Try Again')
menuChoice()
def inputCheck(userChoice):
if userChoice == 1:
print('You Have Chosen to Enter Text to Encrypt!')
enterText()
if userChoice == 2:
print('You Have Chosen to Encypt Entered Text!')
encryptText()
if userChoice == 3:
print('You Have Chosen to Display Encypted Text!')
displayText()
def enterText():
print('Enter Text')
def encryptText():
print('Encrypt Text')
def displayText():
print('Display Text')
main()
질문이 이해가 가지 않습니다. – wRAR
질문을 죄송합니다. – user2166941