-1

I'm writing a basic text adventure game for practice, but when I start this up, no matter what I press, it prints Start normally, then goes to the pot of gold part, adds 10 to G and then ends. For some reason it seems to ignore that there are other possibilities than the first in the if, elif, else statements. Any ideas why this might be and how I could fix it?

start=input("Start")
if start=='yes' or 'Yes':
    G=0
    R=0
    K=0
    u=input("L/R?")
    if u=='l' or 'L':
        L1=input("You see a pot of gold. It has a note attached reading 'please do not take'")
        if L1=='take' or 'Take':
            G=G+10
        else:
            K=K+1

    elif u=='r' or 'R':
        R1=input("You see a burning pyre with a golden goblet placed in front of it. There are strange carvings on the wall")
        if R1=='worship' or 'Worship':
            R=R+10
        elif c1=='take goblet' or 'Take goblet' or 'take' or 'Take':
            R=R-5
            G=G+15
        else:
            K=K+1
else:
  sys.exit
print(G)
print(R)
print(K)
Isosceles
  • 1
  • 1
  • The condition `u == 'l' or 'L'` is always true. You could use `u == 'l' or u == 'L'` or `u in 'lL'` or `u.lower() == 'l'`. – mkrieger1 Oct 23 '19 at 13:27

1 Answers1

0

Use

if u=='l' or u=='L':

instead of

if u=='l' or 'L':

anshulk
  • 458
  • 5
  • 13