Class 12 Computer Science Chapter 2 Advanced Python Programming Quiz 4 (34 MCQs)

Quiz Instructions

Select an option to see the correct answer instantly.

1. Which method would you use to add an item to the end of a list named 'items'?
2. Config() in Python Tkinter are used to .....
3. Which of the following is a valid way to create a comment in Python?
4. Why do we use variables in programming?
5. Colors = ("red", "green", "burnt sienna", "blue")print("yellow" in colors)What is the result of the yellow in colors expression?
6. How can you access elements in a list in Python?
7. What is the purpose of using 'break' in a loop in Python?
8. What is the purpose of using 'elif' in Python?
9. Which of the following is the correct output of the call to below line of code?print(list("hello"))
10. What is the correct way to create a function in Python?
11. Select the correct statement to install sql connector library
12. What are the advantages of python?
13. Colors = ["red", "green", "burnt sienna", "blue"]print(colors[2])What is the output of the above python code?
14. How many times will a 'for' loop iterate if the range is specified as range(5)?
15. List, tuple, and range are the ..... of Data Types.
16. Which symbol is used for single-line comments in Python?
17. What is the output of the following code:t=("CSE", "GEC", 34, 55.5)t[3]=123print(t)
18. Which of the following is a correct way to call a function named 'my ..... function'?
19. What is the meaning of the following comparison operator?a >= b
20. The elements of a tuple are enclosed by .....
21. Who began working on Python in the late 1980s?
22. What will be the output?print (type(5 // 2))
23. The ..... function is used to create Tuples from a list.
24. Creating line belongs to ..... category.
25. Which is correct line to import pandas
26. He is a Dutch Programmer known as the creator of Python?
27. Which arithmetic operators cannot be used with strings in Python?
28. What will be the output of this string operation s[2:5], if s="hello world" -
29. Which method can be used to remove any whitespace from both the beginning and the end of a string?
30. Which command will correctly ask the user for their age?
31. What will be the output of the following Python code? x = 50 def func(x):print('x is', x) x = 2 print('Changed local x to', x) func(x) print('x is now', x)
32. WHICH ONE OF THE FOLLOWING ARE USED RELATION BETWEEN TWO OR MORE VARIABLES?
33. What is the output of the following code snippet:'x = 5if x > 3:print('x is greater than 3')'?
34. You want to sampling 10 from 100 patients (One-by-One). Which one does NOT necessary in your code?