0% found this document useful (0 votes)
0 views2 pages

Python Task 14

The document contains a Python assessment consisting of multiple choice questions, output prediction tasks, and programming questions. It tests knowledge on functions, list methods, loops, and operators in Python. Additionally, it includes programming challenges such as finding the median of sorted arrays and counting words in a sentence.

Uploaded by

ramyargowda1113
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views2 pages

Python Task 14

The document contains a Python assessment consisting of multiple choice questions, output prediction tasks, and programming questions. It tests knowledge on functions, list methods, loops, and operators in Python. Additionally, it includes programming challenges such as finding the median of sorted arrays and counting words in a sentence.

Uploaded by

ramyargowda1113
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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.

You might also like