Python Day 9
Python Day 9
string1 = []
list1 = []
for i in range(1,4):
user_input = eval(input(f"Enter input : "))
if isinstance(user_input, int):
integer1.append(user_input)
elif isinstance(user_input, str):
string1.append(user_input)
elif isinstance(user_input, list):
list1.append(user_input)
print(integer1)
print(string1)
print(list1)
===================================================================================
==
'''ask user to enter the marks in 4 subjets if any
one the subject he scored less than 35 the he is failed ,
otherwise give him a class such as 35-60% second class ,
60-80% first class , more than 80 distinction'''
li = []
for x in range (0,4):
marks = int(input('enter the marks :'))
li.append(marks)
for el in li:
if el > 80:
print('distinction')
elif el <= 80 and el >= 60:
print('first class')
elif el < 60 and el >= 35:
print('second class')
else:
print('fail')
===================================================================================
=