Calculator than can compute the area of a given shape


Hi! Can anyone help me with this error?


$ python
File "", line 26
print "The pie is baking..."
IndentationError: unindent does not match any oute
r indentation level

calculator than can compute the area of a given shape (circle or triangle)

from math import pi
from time import sleep
from datetime import datetime

now =

print "Starting the calculator"

print "Current time: %s/%s/%s %s:%s" % (now.month,, now.year, now.hour, now.minute)


hint = "Dont forget to include the correct units! \n Existing..."

option = raw.input("Enter C for circle or T for Triangle: ")

option = option.upper()

if option == "C":
radius = float(raw.input("Enter radius: "))
area = pi * radius **2
print "The pie is baking..."
print ("Area: %s.2f. \n%s" % (area,hint))

elif option == "T":
base = float(raw.input("Enter the base: "))
height = float(raw.input("Enter the height"))
area = (0.5)baseheight
print "Uni Bi Tri"
print("Area: %s.2f. \n%s" % (area,hint))

print "Enter the correct option otherwise the program will exit"


What's the problem? You've got an error message explaining why your code isn't valid, is there something you're wondering about that message? Have you read it? Have you tried googling it? It mentions indentation, have you considered your indentation at that location? What does your code actually look like? If others are to look at your code and the problem has to do with indentation, then it would be useful if the indentation of your code showed in your post (regardless of what the error message is really, because otherwise you're posting something different from what you're running)


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