forked from sangam92/python_tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbranching.py
More file actions
31 lines (14 loc) · 757 Bytes
/
Copy pathbranching.py
File metadata and controls
31 lines (14 loc) · 757 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#Branching Programs
# A branching condition has three parts :-
# 1.) Test -----an expression that evaluates True and False.
# 2.) Block Code ------- A line of statement that defines the sequence of the code.
# 3.) optional block of code --------in case the above block of code is not executed , this set of code will run.
#Indentation---> it is
# few examples to illustrate :
# For loop :-
a = int(input())
for i in range(a):
if i % 2 == 0 and i > 1:
print(i,"is an even number")
#Python uses indentation unlike other programming languages which uses some sort of brackets like (),{},[].
# In python indenation is a way to write a block of code and it marks the completion of the code.