You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
""" This file is create and managed by Tahir Iqbal
2
+
----------------------------------------------
3
+
It can be use only for education purpose
4
+
"""
5
+
6
+
# Python Statements
7
+
8
+
# - if-else statement
9
+
# Logical conditions used in statements
10
+
# - Equals: a == b
11
+
# - Not Equals: a != b
12
+
# - Less than: a < b
13
+
# - Less than or equal to: a <= b
14
+
# - Greater than: a > b
15
+
# - Greater than or equal to: a >= b
16
+
17
+
# if statement - it is a statement that uses logical condition, if conidition is True then the statement block will run otherwise not
18
+
a=33
19
+
b=55
20
+
ifb>a: # after colon sign next line will written with a tab to show that the next line is in statements block
21
+
print("b is greater than a")
22
+
23
+
# raise an error the statement given below
24
+
"""
25
+
if b > a:
26
+
print("b is greater than a")
27
+
"""
28
+
29
+
# if-else statement - same as above but in this case 'if' condition False then run the code given in 'else' block
30
+
ifb<a:
31
+
print("b is less than a")
32
+
else:
33
+
print("a is less than b")
34
+
35
+
# if-else if-else statement - it works same as if-else but after if block write statement 'else if' or 'elif' in short-form, if 'if' coniditon False then check the 'elif' condition if it is true then run 'elif' block and stop the program
0 commit comments