This is the start of an RPG I am going to make, and It runs smoothly until I try to change the gender by saying yes or any other of the answers that activate the if statement. Is there something I am forgetting? P.S. Sorry about this. I am an amateur.
import random
import time
def Intro():
print('Hit enter to begin.')
input()
print('Please choose a name for your character.')
PlayerName=input()
def KeepName():
print('You have chosen "' + PlayerName + '" as your character\'s name.')
print('Do you wish to keep this as your name? (yes or no)')
return input().lower().startswith('n')
while KeepName():
print('Please choose a name for your character.')
PlayerName=input()
planet = 'Sykahrox VII' #Useless as of this point but I kept it in so I can remember the name of the planet.
def gender():
print('Do you want to be Male, or Female?')
choice = input().lower()
if choice in ('m', 'male', 'boy', 'guy', 'dude'):
return 'Male'
if choice in ('f', 'female', 'girl', 'woman'):
return 'Female'
ChangeGen = 'y'
while ChangeGen in ('y', 'yes', 'yeah', 'yup'):
genderchoice = gender()
print ('You have chosen ' + genderchoice + ' as your gender. Do you wish to change this?')
ChangeGen = input().lower
if ChangeGen in ('y', 'yes', 'yeah', 'yup'):
gender()
Intro()