How to connect these 2 statements in python -
if ask == "yes" or ask == "yes": print("lets go, if dont know question can 'i dont know' leave gameshow") else: if ask == "no" or ask == "no": print("then go home") exit(ask) print("what capital of sarajevo?") if ask == "sarajevo" or ask == "sarajevo": print("correct, move on") else: if ask == "i don't know" or ask == "i don't know": print("sorry isn't correct, lost") exit(ask)
whatever try end being printed
for whole thing make sense, ask
has provided user using input()
. going assume is. below modified version of code. note not have case correctly. can convert whatever answer given lowercase using lower()
method of strings.
ask = input('please provide answer..\t') if ask.lower() == "yes": print("lets go, if dont know question can 'i dont know'") print("what capital of sarajevo?") ask = input('please provide answer..\t') if ask.lower() == "sarajevo": print("correct, move on") else: print("sorry isn't correct, lost , have leave gameshow") elif ask.lower() == "no": print("then go home")
take @ , tell me if works you. ☺
Comments
Post a Comment