Encountering indentation error - Python (Area Calculator)


#1

When I attempt to run the script I receive and indentation error (unident does not match any outer indentation level) on line 20 (area = pi * radius**2). I've messed with trying to fix the indentation levels by backspacing to previous lines, etc but it is not working and I do not know how to correct the issue. Any guidance would be greatly appreciated.


#2

Point1.
Check this line, You misspelled something ?

print "The current time is: %s%s%s %s%s" % (now.moth, now.day, now.year, now.hour, now.minute)

Point2.
you mixed tabs and spaces together while indentation, even they look at same level they are not same spaces.
So just go through each line of your if -block and elif- block , unindent them then indent each line of code by 4-space bars. Remember every line of code in each block should be on same level of indentation.

Point3.

print ("Area: &.2f. \n%s" % (area,hint))

what & doing there ?


#3

Thank you for your assistance. I made all of the updates and they work.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.