Unexpected indent on the first if statement on the area calculator project


#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

When the code begins to run the error message unexpected indent appears when it should work otherwise I have no idea how to fix the if statement that i made


if option == 'C':
  radius = float(raw_input("Enter radius: "))  
  area = 3.14159 * radius ** 2
 print "area %f" % area 


please help


#2

check your print statement, try indenting it one space forward


#3

Thanks for the help. it works now


#4

if you could help with another problem that would be great

print “Area: %f”% area

it says that this code doesn’t match an outer indentation level


#5

you have to check the spaces you leave under your code either by shifting it forwards or backwards and make sure they align. you can also hit the delete button on the previous line to drag back you code and press enter to get the correct indentation


#6

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