I'm working on a project for school. I have to write a small text adventure game however my code has suddenly stopped working. when I try to run the code it highlights 'spouse = wife' and then gives an error saying 'can't assign to operator' How do I fix this and what is going wrong here? It was working before.
print("You wake up in the middle of nowhere feeling dizzy and confused. You don't remember who you are or how you got here.")
option_1 = input("do you want to look for clues? >")
if option_1 == 'yes' or option_1=='Yes' or option_1 == 'Y' or option_1=='y':
print("you look around you but it is snowing and you can't see very far. You see an object in the distance")
option_2=input("do you investigate the object? >")
if option_2=='yes' or option_2=='Yes' or option_2== 'Y' or option_2== 'y':
print("you found a backpack. Maybe it's yours.")
option_3=input("would you like to open the backpack? >")
if option_3 == 'Yes' or option_3 =='yes' or option_3 == 'y' or option_3 == 'Y':
print ("The contents of the backpack jog some of your memory. It's yours!")
name_f = input('What is your first name?')
name_l = input("What is your last name?")
gender = input("what is your gender?")
if gender == 'male' or gender == 'Male' or gender == 'M' or gender == 'm':
spouse = 'wife' and spouse_name = 'Georgia' and pronoun = 'he'
if gender == 'female' or gender == 'Female' or gender == 'F' or gender == 'f':
spouse = 'husband' and spouse-name = 'George' and pronoun = 'she'
print("you find a letter from your", spouse, "it is not addressed to you:")
print("Dear Mr. Adams"+",")
print("I hope this finds you keeping well. I am afraid I won't be able to attend our meetings anymore. I hope I haven't disappointed you but", name_f, "has been asking too many questions and i'm worried that", pronoun+"'s", "getting suspicious")
print("yours,", spouse_name, name_l)
else:
print("you do not survive: game over")
else:
print("you do not survive")
Aucun commentaire:
Enregistrer un commentaire