or statement invalid syntax
<p>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 </p>

<pre><code>#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")
</code></pre>

<p>When you use the 'or' operator, you use it as part of the condition.
For example:</p>

<pre><code>if x == 1 or x == 5:
    print(x)
</code></pre>

<p>So your code would be one long line, without all of the print statements:</p>

<pre><code>if age1 == "20" or age1 == "21" or age1 == "22" or age1 == "23" or age1 == "24" or age1 == "25":
    print("")
</code></pre>

<p>From your code I think what you want is an elif statement:</p>

<pre><code>if age1 == "20":
    ##Do something based on input of 20
elif age1 == "21":
    ##Do something else if input is 21
elif age1 == "22":
    ##Something else again if input is 22
else:
    ##Do something if the age is not captured above.
</code></pre>

<p>You only need to use the "or" operator if you need one of two or more conditions to be true. But if you just want to check if the input age is within the range try this:</p>

<pre><code>if inval &gt;= 20 and inval &lt;= 25:
    print("Correct Value")
else:
    print("Incorrect value")
</code></pre>

<p>Or, using range:</p>

<pre><code>if inval in range(20, 26):
    print("Correct Value")
else:
    print("Incorrect value")
</code></pre>

python python-3.x