Skip to content

Commit 563b8ad

Browse files
author
hussienalrubaye
committed
loops
1 parent 4307761 commit 563b8ad

File tree

6 files changed

+233
-50
lines changed

6 files changed

+233
-50
lines changed

.idea/workspace.xml

Lines changed: 146 additions & 50 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

LoopControl.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
3+
4+
5+
def main():
6+
word="python"
7+
for letter in word:
8+
if(letter=='t'):
9+
pass
10+
print(" blcok is padded")
11+
print(letter)
12+
print("progam end")
13+
14+
15+
if __name__ == '__main__':main()

conditional_nested_if.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
def main():
2+
Degree=input("enter your Degree:")
3+
if(int(Degree)>=90 ):
4+
print("hi")
5+
x=5
6+
if(int(Degree)>94):
7+
print("Your Score is +A")
8+
else:
9+
print("Your Score is -A")
10+
elif(int(Degree)>=80 and int(Degree)<=89):
11+
print("Your Score is B")
12+
elif(int(Degree)>=70 and int(Degree)<=79):
13+
print("Your Score is C")
14+
elif(int(Degree)>=60 and int(Degree)<=69):
15+
print("Your Score is D")
16+
elif(int(Degree)>=50 and int(Degree)<=59):
17+
print("Your Score is E")
18+
else:
19+
print("You Fail")
20+
21+
22+
if __name__ == '__main__':main()

loop_While.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
3+
4+
5+
def main():
6+
print("program start")
7+
i=1
8+
while(i<100):
9+
if(i% 4==0):
10+
print("Count {}".format(i))
11+
i+=1
12+
13+
print("progarm end")
14+
15+
16+
17+
if __name__ == '__main__':main()

loops_for.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
3+
4+
5+
def main():
6+
l=[1,3,4,'hi',3.4]
7+
print(range(5))
8+
for i in range(5):
9+
print(l[i])
10+
11+
12+
13+
14+
15+
if __name__ == '__main__':main()

loops_nested_loop.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
3+
4+
5+
def main():
6+
i=0
7+
while(i<5):
8+
print("i={}".format(i))
9+
i+=1
10+
j=5
11+
while(j>i):
12+
print("j={}".format(j))
13+
j-=1
14+
15+
16+
17+
18+
if __name__ == '__main__':main()

0 commit comments

Comments
 (0)