Python MCQ (Multiple Choice Questions)

#1. Which of the following methods adds an item to a list?

#2. What is the output of the above code?

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

#4. Which type of Programming does Python support?

#5. Which of the following can be used to generate random numbers in Python?

#6. Which of the following is the correct way to create a set in Python?

#7. What is the output of the above code?

#8. What is the output of the above code?

#9. What is the output of the above code?

#10. What is the output of the above code?

#11. Which of the following is used to create an object in Python?

#12. How do you create a variable with the floating number 2.8?

#13. What is the output of the above code?

#14. What is the data type of the above?

#15. Which method can be used to return a string in upper case letters?

#16. Which of the following functions converts a string to a list of characters?

#17. What is the output of the above code?

#18. What will be the output of the above Python code?

#19. Which of the following functions can help us to find the version of python that we are currently working on?

#20. Which of the following will convert a string to a floating-point number in Python?

#21. Which of the following statements is used to handle exceptions in Python?

#22. What will be the output of the above code?

#23. What is the output of the above code?

#24. Which of the following methods is used to find the position of a substring in a string?

#25. Which of the following is used to define a block of code in Python?

#26. What is the correct syntax to import a specific function from a module in Python?

#27. Which of the following is not a valid keyword in Python?

#28. What is the output of the above code?

#29. Which function can be used to read data from a file?

#30. How do you insert COMMENTS in Python code?

Finish

Results

DarkLight
×