forked from Mohammad-Faiz/Selenium_Course
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloops.py
More file actions
47 lines (24 loc) · 647 Bytes
/
loops.py
File metadata and controls
47 lines (24 loc) · 647 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
greeting = "Good Morning"
a = 4
if a > 2:
print(" Condition matches")
print("second line")
else:
print("condition do not match")
print("if else condition code is completed")
#for loop
obj= [2, 3, 5, 7, 9]
for i in obj:
print(i*2)
# sum of First Natural numbers 1+2+3+4+5 = 15
#range(i,j) -> i to j-1
summation = 0
for j in range(1, 6):
summation = summation + j
print(summation)
print("*******************************")
for k in range(1, 10, 5):
print(k)
print("**************SKIPPING FIRST INDEX*****************")
for m in range(10):
print(m)