Python Assessment
Multiple Choice Questions
1. Which function is used to get the largest value in a list?
○ A. high()
○ B. max()
○ C. largest()
○ D. top()
2. Which method removes an item from a list?
○ A. delete()
○ B. remove()
○ C. clear()
○ D. popitem()
3. What is the output of:
print("5" + "5")
● A. 10
● B. 55
● C. Error
● D. 25
4. Which loop is used when the number of iterations is known?
○ A. while
○ B. do-while
○ C. for
○ D. if
5. Which operator checks whether a value exists in a list?
○ A. is
○ B. in
○ C. ==
○ D. not
Output Prediction
1.
x = [1, 2, 3, 4]
print(x[1:3])
2.
for i in range(2):
print("AI")
3.
a = [10, 20]
[Link](1, 15)
print(a)
4.
print("Python".upper())
5.
print(7 % 3)
Programming Questions
1. Write a Python program to find the median value after combining two sorted arrays.
2. Write a Python program to find the missing number from an array containing numbers
from 0 to n.
3. Write a Python program to count words in a sentence.
4. Write a Python program to merge two lists.