I'm making a simple text game in Python 3, and I tried to make an input statement, but when I answer it, the program closes. How can I fix this?
I've tried Googling it, but I just see "program closes straight after opening it".
def startgame():
print("####################")
ign = input("Type a name. ")
print("####################")
namedecision = input("You have picked " + ign + ".\nAre you sure you want\nto keep this name? (Y/N) ")
if namedecision == ['y','Y']:
# put game func
print("####################")
if namedecision == ['n', 'N']:
ign = input("Type a name. ")
namedecision = input("You have picked " + ign + ".")
print("####################")
# game func
startgame()
I expect that if I typed Y or N it would execute the proper functions.