Python Conditional and if statements:
IF Statement:
IF condition:Statement(true part)
For eg:
a=7if a>5:Print("a is greater")
Else Statement:
if condition:Statement(true part)else :Statement(false part)
For eg.
Elif Statement:
if condition:Statement(true part)elif condition:Statement(true part 2)else :Statement(false part)
Indentation:
Python relies on indentation (whitespace at the beginning of a line) to define the scope in the code. Other programming languages often use curly-brackets for this purpose.
For eg.
a = 33
b = 200
if b > a:
print("b is greater than a") # you will get an error
0 Comments
Doubts? Please let our team know So that we can serve you better.