indentation in python

L

lee

Can anyone tell me the basics about indentation in python......how we
use it in loops and constructs..etc....
 
D

Dan Bishop

Can anyone tell me the basics about indentation in python......how we
use it in loops and constructs..etc....

It's just like indentation in other languages, except that it's
syntactically required.
 
W

Wolfgang Grafen

Dan said:
It's just like indentation in other languages, except that it's
syntactically required.
The indent rule is minimal:
- indent the following line after a colon :))
- dedent when you leave that block to the level you wish to continue
- you cannot have an empty block; use pass or None for an otherwise empty block
- as always: have fun!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top