Python Forum
Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Indentation if/else problem
#1
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
Reply


Messages In This Thread
Indentation if/else problem - by Rikk - May-25-2018, 01:01 PM
RE: Indentation if/else problem - by buran - May-25-2018, 01:06 PM
RE: Indentation if/else problem - by Rikk - May-25-2018, 01:08 PM
RE: Indentation if/else problem - by buran - May-25-2018, 01:10 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Mysterious Indentation Problem Dakodak 11 6,736 Jun-24-2019, 06:23 AM
Last Post: Dakodak

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020