My Report

Python Programming Mock Test 5


Correct Answer: 2 points | Wrong: -1 point
Grades: A* (100% score) | A (80%-99%) | B (60%-80%) | C (40%-60%) | D (0%-40%)
advertisement
 10%

Question 1 of 10

1. Input order is preserved in sets.

Question 1 of 10

Question 2 of 10

2. What will be the output of the following Python code?

s={4>3, 0, 3-3}
all(s)
any(s)

Question 2 of 10

Question 3 of 10

3. If a is a dictionary with some key-value pairs, what does a.popitem() do?

Question 3 of 10

Question 4 of 10

4. What will be the output of the following Python code?

>>> a={1,2,3}
>>> b=a
>>> b.remove(3)
>>> a

Question 4 of 10

Question 5 of 10

5. Which of the following isn’t true about dictionary keys?

Question 5 of 10

Question 6 of 10

6. Which of the following is not a declaration of the dictionary?

Question 6 of 10

Question 7 of 10

7. What will be the output of the following Python function?

{x for x in 'abc'}
{x*3 for x in 'abc'}

Question 7 of 10

Question 8 of 10

8. Suppose d = {"john":40, "peter":45}, to delete the entry for "john" what command do we use?

Question 8 of 10

Question 9 of 10

9. If a={5,6,7,8}, which of the following statements is false?

Question 9 of 10

Question 10 of 10

10. The following Python code results in an error.

s={2, 3, 4, [5, 6]}

Question 10 of 10


 

Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.