[Solved] Python conditional syntax error [closed]


Python does not use curly braces like most other languages. Instead it uses a colon : and whitespace to determine blocks. You also do not need (and shouldn’t put) semicolons ; at the end of every line. In addition, you do not need parenthesis around conditions in if/while/etc. statements.This is the correct way to write your code:

print ("If you are married press 1 if you are single press 2")
answer = raw_input("")
if answer == 1:
    print "Enter your income"
elif answer == 2:
    print "Enter your income"

solved Python conditional syntax error [closed]