Python Pandas Mock Test

Note:- Read each question carefully and select the most appropriate answer. Complete the test within the allotted time and review your answers before submission. Once submitted, your score and correct answers will be displayed.

1. How do you create a tuple containing the values 1, 2 and 3?

 
 
 

2. Which dictionary method returns a value for a key without raising an error if the key is missing?

 
 
 
 

3. Which method adds one item to the end of a list?

 
 
 
 

4. Which operator is used for exponentiation in Python?

 
 
 
 

5. Which statement imports Python’s math module?

 
 
 
 

6. What is the purpose of the return statement in a function?

 
 
 
 

7. Which symbol is used for a single-line comment in Python?

 
 
 
 

8. Which collection is ordered and changeable?

 
 
 
 

9. What does the range(5) function produce when used in a loop?

 
 
 
 

10. Which keyword is used to handle exceptions?

 
 
 
 

11. Which statement is used to make a decision in Python?

 
 
 
 

12. Which keyword skips the current loop iteration and moves to the next one?

 
 
 
 

13. What is the index of the first character in a Python string?

 
 
 
 

14. Which data structure stores key-value pairs?

 
 
 
 

15. What is the result of 17 // 5?

 
 
 
 

16. Which data type stores True or False values?

 
 
 
 

17. Which string method converts text to lowercase?

 
 
 
 

18. Which of the following is a valid Python variable name?

 
 
 
 

19. Which built-in function returns the number of items in a list?

 
 
 
 

20. Which function is used to get input from a user?

 
 
 
 

21. Which block is used to wrap code that may raise an exception?

 
 
 
 

22. Which keyword exits a loop immediately?

 
 
 
 

23. Which loop is commonly used to iterate over a sequence?

 
 
 
 

24. Which keyword is used to define a function in Python?

 
 
 
 

Question 1 of 24