May-25-2018, 01:01 PM
I need assistance with writing if/else statements on Python 3.6. I am working on an iMac OS High Sierra (v 10.13.4). This is what I write:
>>> x = 10
>>> if x < 10:
print ('less than ten')
else:
SyntaxError: inconsistent use of tabs and spaces in indentation
>>>
After the print statement my cursor returns to under the 'p' of print. In order to get the curser under the 'i' in the if statement , I have to use back arrows and forward arrows to align them. I always get the SyntaxError message. I also noticed in the tutorial that after the print statement there are three ... under the >>> prompt to write the else or elif command. I have been working on a solution for hours but cannot come up with one. If anyone can help me I would surly appreciate it. Thank you. Rikk
>>> x = 10
>>> if x < 10:
print ('less than ten')
else:
SyntaxError: inconsistent use of tabs and spaces in indentation
>>>
After the print statement my cursor returns to under the 'p' of print. In order to get the curser under the 'i' in the if statement , I have to use back arrows and forward arrows to align them. I always get the SyntaxError message. I also noticed in the tutorial that after the print statement there are three ... under the >>> prompt to write the else or elif command. I have been working on a solution for hours but cannot come up with one. If anyone can help me I would surly appreciate it. Thank you. Rikk