Thread: Python: IndentationError: expected an indented block
hi, trying first python program , having little bit of trouble. "indentationerror: expected indented block". tried searching google solution , found not implement them. trying after reading few tutorials , book python. appreciate if indicate me how fix error. thank you.
here code:
if see syntax errors please indicate them me. can see beginner.
this error output terminal:code:#size_calculator.py #!/usr/local/bin/python import time import datetime today = datetime.date.today() print "the date is", today print('this program calculates perimeter, surface, , volume.') def selection() : d = raw_input( 'enter p calculate perimeter, enter v calculate volume, enter s calculate surface, or ctrl+c exit! p/v/s :') if d == 'p': def perimeter(): while 1: a= raw_input('enter lenght: ') b= raw_input('enter width: ') print('the perimeter is'),a+b selection if d == 'v' : volume() if d == 's' : surface() if d == 'p' : perimeter() print('the program exit, thank using it.') raw_input('press <enter> exit') if d == 'v': def volume(): while 2: g= input('enter height: ') f= input('enter lenght: ') h= input('enter width: ') print('the volume '),g*f*h selection if d == 'v' : volume() if d == 's' : surface() if d == 'p' : perimeter() print('the program exit, thank using it.') raw_input('press <enter> exit') if d == 's': def surface(): while 3: n= input('enter lenght: ') m= input('enter width: ') print('the surface '),n*m selection if d == 'v' : volume() if d == 's' : surface() if d == 'p' : perimeter() print('the program exit now, thank using it.') raw_input('press <enter> exit')
code:cgroza@cgroza-desktop:~/desktop$ python program.py file "program.py", line 16 def perimeter(): ^ indentationerror: expected indented block cgroza@cgroza-desktop:~/desktop$ python program.py file "program.py", line 16 def perimeter(): ^
bump
Forum The Ubuntu Forum Community Ubuntu Official Flavours Support General Help [all variants] Python: IndentationError: expected an indented block
Ubuntu
Comments
Post a Comment