Let me start off by saying that I am COMPLETELY new to programming. I have just recently picked up Python and it has consistently kicked me in the head with one recurring e
in python .....intendation matters, e.g.:
if a==1:
print("hey")
if a==2:
print("bye")
print("all the best")
In this case "all the best" will be printed if either of the two conditions executes, but if it would have been like this
if a==2:
print("bye")
print("all the best")
then "all the best" will be printed only if a==2
This one is wrong at least:
for x in range(x, 1, 1):
elif option == 0:
Your for
loop has no loop body:
elif option == 2:
print "please enter a number"
for x in range(x, 1, 1):
elif option == 0:
Actually, the whole if option == 1:
block has indentation problems. elif option == 2:
should be at the same level as the if
statement.