Fall 2022_CS441_1
Fall 2022_CS441_1
Student ID : BC210423245
Instructions:
Please read the following instructions carefully before solving & submitting assignment:
It should be clear that your assignment will not get any credit (zero marks) if:
Objectives:
GOOD LUCK
Marks: 20
Question No. 01:
Consider the following lists which are showing marks of different students in the Subjects of “Mathematics” and
“English.
List 1: Marks in Mathematics= 25, 44, 66, 65, 85, 78, 91, 18, 24, 51
List 2: Marks in English= 25, 44, 66, 65, 85, 81, 91, 1, 24, 51
You are required to write a program in python in which marks of both of these classes should be stored in the
form of Tuples. After storing marks, write code to perform the following tasks.
1. Find length of both List 1 and List 2.
2. Find lowest marks in both lists.
3. Find sum of marks of List 1 and List 2.
4. Compare whether List 1 is equal to List 2 or not.
5. Print output of all the given tasks on your screen.
Program:
list1 = [25, 44, 66, 65, 85, 78, 91, 18, 24, 51]
list2 = [25, 44, 66, 65, 85, 81, 91, 1, 24, 51]
tuple1 = tuple(list1)
tuple2 = tuple(list2)
# Find the length of both lists
length1 = len(list1)
length2 = len(list2)
print(length1)
print(length2)
lowest1 = min(list1)
lowest2 = min(list2)
print(lowest1)
print(lowest2)
sum1 = sum(list1)
sum2 = sum(list2)
print(sum2)
if list1 == list2:
print("It is equal")
else:
Write a program in Python which should get a number from the user and check whether the number is even or
odd.
Program:
if number % 2 == 0:
else: