Hey guys again, well i got another question. When ever i have an if statement asking for input and i try to use an elif statement and run the code, it say's 'elif' is an syntax error. Is it an indention problem or something else? Thanks

print "1) Play"

if choice == 1:
    ways = ['L','R','S']
    ways = raw_input("Which way do you want to go(L,R,S)?: ")

    elif direction == 'L':
        print "You have gone left."

Yes, it's indention problem.

print "1) Play"

if choice == 1:
    ways = ['L','R','S']
    ways = raw_input("Which way do you want to go(L,R,S)?: ")

elif direction == 'L':
        print "You have gone left."

And one more question, here in this code:

print "Your choices are: "
print "1) Play"
choice = raw_input("Choose your option(1) ")

loop = 1

if choice == '1':
   dir_list = ['N','S','E','W']
   print "Your on an adventure to find the treasure!"
   print "You will go throughout many places in search of the treasure, Good luck!"
direction = raw_input("Which direction do you want to go(N,S,E,W)?: ").upper()

if direction == 'N':
    way_list = ['Left','Right','Straight']
    print "-_-_-_-_-_-_-_-_-_-_-_-"
    print "You approach an old house,"
    print "The door is unlocked and you go inside"
    direction = raw_input("Which way do you want to go('Left,Right,Straight)?: ")

elif direction == 'Left':
    print "You have gone left"

Whenever i type 'Left' the programs breaks, any suggestions?

print "Your choices are: "
print "1) Play"
choice = raw_input("Choose your option(1) ")

loop = 1

if choice == '1':
   dir_list = ['N','S','E','W']
   print "Your on an adventure to find the treasure!"
   print "You will go throughout many places in search of the treasure, Good luck!"
direction = raw_input("Which direction do you want to go(N,S,E,W)?: ").upper()

if direction == 'N':
    way_list = ['Left','Right','Straight']
    print "-_-_-_-_-_-_-_-_-_-_-_-"
    print "You approach an old house,"
    print "The door is unlocked and you go inside"
    direction = raw_input("Which way do you want to go('Left,Right,Straight)?: ")

    if  direction == 'Left':
    	print "You have gone left"
    elif direction == 'Right':
    	 print "You have gone right"
    else:
    	 print "You have gone Straight"

You indented "elif" in manner to check the first input

direction = raw_input("Which way do you want to go('Left,Right,Straight)?: ")
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.