Skip to content

Commit 7c805c2

Browse files
committed
new-example
1 parent cf8fc49 commit 7c805c2

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

exaples3.py

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
x = 5
2+
s = 'Mahmod Ahmed'
3+
print(type(x))
4+
print(type(s))
5+
6+
7+
print('---------------------')
8+
9+
# python if else example:
10+
11+
x = 500
12+
if x > 600:
13+
print('x is bigger than 600')
14+
else:
15+
print('x is smaller than 600')
16+
17+
18+
print('---------------------')
19+
20+
21+
#python elif example:
22+
23+
x = 100
24+
if x == 200:
25+
print('x = 200')
26+
elif x == 150:
27+
print('x = 150')
28+
elif x == 300:
29+
print('x = 300')
30+
else:
31+
print('this is the default option')
32+
print('rest of the code')
33+
34+
35+
print('---------------------')
36+
37+
#python nested if example:
38+
39+
x = 100
40+
if x < 200:
41+
print('x is less than 200')
42+
43+
if x == 150:
44+
print('x = 150')
45+
elif x == 50:
46+
print('x = 50')
47+
elif x < 50:
48+
print('x is less than 50')
49+
print('rest of the code')

0 commit comments

Comments
 (0)