Vlad Conovali Vlad Conovali - 2 months ago 7
Python Question

or statement invalid syntax [SOLVED]

So, a friend of mine told me about or statements but when I use it, it says invalid syntax... but won't tell me where

#Fun Game

print("Enter name")

firstname = input()

print ("Thousands of years further from our time, the continents collided, creating mass devastation and heat.You,"+firstname+" lived in a peacful village until")

print (" your village was raided by four men, everyone else died other than you, who was trained as an assasin and killed them all")

age1 = input ("you,"+firstname+" as a 16 year old killed them all and escaped into a cave. Now that cave is what you call home.Enter your character's current age(max 25 min 20) ")

if age1 == "20":
print("")

or age1 == "21":
print("")

or age1 == "22":
print ("")

or age1 == "23":
print ("")

or age1 == "24":
print ("")

or age1 == "25":
print("")

else:
print ("Choose an age in the list")

cave1 = input ("You can do 2 things:")

print ("1.Go to your friend's village(700 people,military grade)and trade,look for bountys and find news")


YOU ALL HELPED, THANKS I LIKE SEEING SUPPORT BY MY SIDE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Answer

Poonam's answer looks fine, but you probably also don't want that many if statements:

print("Enter name")

firstname = input()

print ("Thousands of years further from our time, the continents collided, creating mass devastation and heat.You,"+firstname+" lived in a peacful village until")

print (" your village was raided by four men, everyone else died other than you, who was trained as an assasin and killed them all")

age1 = input ("you,"+firstname+" as a 16 year old killed them all and escaped into a cave. Now that cave is what you call home.Enter your character's current age(max 25 min 20) ")

if age1 in ["20","21","22","23","24","25"]:
  print("")
else:
  print ("Choose an age in the list")

cave1 = input ("You can do 2 things:")

print ("1.Go to your friend's village(700 people,military grade)and trade,look for bountys and find news")