-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path03_conditions.py
More file actions
41 lines (36 loc) · 826 Bytes
/
03_conditions.py
File metadata and controls
41 lines (36 loc) · 826 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
def is_even (x):
return x % 2 == 0
a= is_even (22)
print (a)
b= is_even (21)
print (b)
mark = int( input (" What is the mark ? "))
category = ""
if mark >= 55:
result = " pass "
if mark < 80:
category = " average "
else :
category = " exceptional "
else:
result = " fail "
print (result , category )
def day_of_week (n):
if n == 0:
print (" Monday ")
elif n == 1:
print (" Tuesday ")
elif n == 2:
print (" Wednesday ")
elif n == 3:
print (" Thursday ")
elif n == 4:
print (" Friday ")
elif n == 5:
print (" Saturday ")
elif n == 6:
print (" Sunday ")
else :
print (" value not correct ")
a = int( input (" What is the day? "))
day_of_week (a)