Python Forum

Full Version: coding doesent work???
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hey all i am using python 3.3.3 in idle (i know its outdated) but i am trying to make a siple if statment however it wont work and says invalid syntax if i try to run it and highllights the word else. what have i done wrong?? here it is

print ("hello world")
myName = input("what is your name?")

if(myName == "Louis" or "louis"):
    print("Louis is so amazing")

    else print("you are ok")
thanks,Darbandiman123 Think LOL
else needs to be indented to the same degree as its respective if. You have it indented too much. You're also missing a colon after else. Once those are resolved, I recommend you check out http://python-forum.io/Thread-Multiple-e...or-keyword
Hello!
Use the python code tags, please!

print ("hello world")
myName = input("what is your name?")

if myName.lower() == "louis":
    print("Louis is so amazing")

else:
     print("you are ok")
You forgot ':' after else.