-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path02ndConditionStatementsinPython.py
More file actions
68 lines (43 loc) · 1.11 KB
/
02ndConditionStatementsinPython.py
File metadata and controls
68 lines (43 loc) · 1.11 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# ! If, Else % Elif statements
if 18 <= int(input('Enter age:\n')):
print('Eligible for voting')
else:
print('Can\'t vote')
a = 5
b = 10
if a > b:
print('A is greater than B')
elif a == b:
print('A is equal to B')
else:
print('A is less than B')
name = input('Enter name:')
a = int(input('Enter Marks for subject 1:'))
b = int(input('Enter Marks for subject 2:'))
c = int(input('Enter Marks for subject 3:'))
d = int(input('Enter Marks for subject 4:'))
e = int(input('Enter Marks for subject 5:'))
if 90 <= ((a+b+c+d+e)/500)*100 <= 100:
print('Grade S')
elif 80 <= ((a+b+c+d+e)/500)*100 < 90:
print('Grade A')
elif 70 <= ((a+b+c+d+e)/500)*100 < 80:
print('Grade B')
elif 60 <= ((a+b+c+d+e)/500)*100 < 70:
print('Grade C')
elif 50 <= ((a+b+c+d+e)/500)*100 < 60:
print('Grade D')
else:
print('Grade F')
if True:
print('Let\'s gooooooooooooo')
else:
print('Its fine')
n = input('Enter a no.:')
if n==n[::-1]:
print('Palindrome')
else:
print('Not Palindrome')
# ! Ternerary operators
marks = 80
g = 'Good' if marks < 80 else 'b is min'