Skip to content

Commit 4307761

Browse files
author
hussienalrubaye
committed
conditiona;
1 parent 283d901 commit 4307761

6 files changed

+367
-48
lines changed

.idea/workspace.xml

+309-47
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Dictionary.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11

22

33

4-
54
def main():
65
#Student={'Name':"hussein alrubaye",'Age':27,'Slary':232.5};
76
Student=dict(Name="hussein alrubaye",Age=27,Slary=232.5);
@@ -14,6 +13,7 @@ def main():
1413
print(Student['Age'])
1514
Student.clear()
1615
print(Student,type(Student))
16+
1717

1818

1919

condition_if_simple.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
def main():
2+
Age=input("enter your Age:")
3+
if(int(Age)>18):
4+
print("welcome")
5+
6+
7+
8+
9+
10+
if __name__ == '__main__':main()

conditional_if_elif.py

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
def main():
2+
Age=input("enter your Age:")
3+
if(int(Age)>=8 and int(Age)<=10):
4+
print("children")
5+
print("children")
6+
print("children")
7+
print("children")
8+
elif(int(Age)>=11 and int(Age)<=15):
9+
print("kids")
10+
elif(int(Age)>=16 and int(Age)<=18):
11+
print("Tingers")
12+
elif(int(Age)>=19 and int(Age)<=30):
13+
print("Young")
14+
else:
15+
print("Out of range")
16+
print("End")
17+
18+
19+
20+
21+
22+
if __name__ == '__main__':main()

conditional_if_else.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
def main():
2+
Age=input("enter your Age:")
3+
if(int(Age)>18):
4+
print("welcome")
5+
else:
6+
print("Not Welcome")
7+
8+
9+
10+
11+
12+
13+
if __name__ == '__main__':main()

my_age.py

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import datetime
2+
3+
def main():
4+
DOB=input("Enter your DOB:")
5+
YearNow=datetime.datetime.now().year
6+
MyAge=YearNow-int(DOB)
7+
print("Your age is {} Year".format(MyAge))
8+
9+
10+
11+
12+
if __name__ == '__main__':main()

0 commit comments

Comments
 (0)