Home | | Problem Solving and Python Programming | Lines and Indentation - Python

Chapter: Problem Solving and Python Programming : Data, Expressions, Statements

Lines and Indentation - Python

Most of the programming languages like C, C++, Java use braces { } to define a block of code.

LINES AND INDENTATION:

 

v   Most of the programming languages like C, C++, Java use braces { } to define a block of code. But, python uses indentation.

v   Blocks of code are denoted by line indentation.

v   It is a space given to the block of codes for class and function definitions or flow control.


Example:

a=3

b=1

if a>b:

print("a is greater")

else:

print("b is greater")

 

Study Material, Lecturing Notes, Assignment, Reference, Wiki description explanation, brief detail
Problem Solving and Python Programming : Data, Expressions, Statements : Lines and Indentation - Python |

Related Topics

Problem Solving and Python Programming : Data, Expressions, Statements


Privacy Policy, Terms and Conditions, DMCA Policy and Compliant

Copyright © 2018-2024 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.