subjects

Dropdown Menu

Monday, 15 February 2021

Indentation

 Indent is cursor position used to represent group of statements. At the interactive prompt, we have to type a tab or space(s) for each indented line.

All decent text editors have an auto-indent facility. Each line within a basic block will have same amount of indent

Ex:
 Sum.py

              def add ( ):

                        a = int (input (“Enter first value”))

                        b = int (input (“Enter second value”))

                        print (“Sum of two numbers”, a+b)

               add ( )

 

No comments:

Post a Comment