1. What is the output of print(type([]))? A) <class ‘list’> B) <class ‘tuple’> C) <class ‘array’> D) <class ‘set’>
2. Which of the following is not a valid Python data type? A) list B) dict C) array D) tuple
3. What is the correct way to start a function in Python? A) function myFunc(): B) def myFunc(): C) create myFunc(): D) function: myFunc()
4. Which keyword is used for a loop in Python? A) loop B) iterate C) for D) repeat
5. What does the len() function do? A) Returns the length of a string B) Returns the type of an object C) Returns the largest number D) Lists all elements
6. Which of the following is used to handle exceptions in Python?
A) try-except B) do-catch C) error-trap D) try-catch
7. What will print(2 ** 3) output? A) 5 B) 6 C) 8 D) 9
8. What will myList = [1, 2, 3]; print(myList[1]) output? A) 1 B) 2 C) 3 D) Error
9. What is the result of bool([]) in Python? A) True B) False C) None D) Error
10. What does break do in a loop? A) Skips to the next iteration B) Ends the current loop C) Pauses the loop D) Restarts the loop
11. Which statement is true about Python? A) Python is compiled only B) Python uses curly braces for blocks C) Python is dynamically typed D) Python is case-insensitive
12. What is a correct way to import only the sqrt function from the math module? A) import sqrt from math B) from math import sqrt C) math import sqrt D) include math.sqrt