Indent error in iron python -


flucommands = """ library:     cel:     &replace expressions:     massflowrate = """  flucommands = flucommands + 0.43 + "[kg s^-1]"  flucommands = flucommands + """ temp = """  flucommands = flucommands + 843.15 + "[k]"  counttt = 1 while (counttt<=3): flucommands = flucommands + "porositysub" + countt  flucommands = flucommands + " = " + 0.75 + "\n"  counttt = counttt + 1 

i error

'flucommands = flucommands + "porositysub" + countt' error 'expect indented block'

any appreciated. thanks!!!

this needs indenting:

while (counttt<=3):     flucommands = flucommands + "porositysub" + countt      flucommands = flucommands + " = " + 0.75 + "\n"      counttt = counttt + 1 

python uses indentation instead of braces (in other languages) statement blocks.

without while: loop not defined hence error received.

see: http://www.tutorialspoint.com/python/python_while_loop.htm , https://docs.python.org/2.3/ref/indentation.html


Comments