Python MCQ Questions and Answers Quiz

11. In python which keyword is used to start function ?

  1. function
  2. def
  3. try
  4. import

12. which function is used to open the file for reading in python ?

  1. fopen(filename, mode)
  2. open(filename, mode)
  3. openfile(filename, mode)
  4. open_file(filename, mode)

13. Which of the following function returns the min alphabetical character from the string str?

  1. lower()
  2. lstrip()
  3. max(str)
  4. min(str)

14. What is the following function compares elements of both lists?

  1. cmp(list1, list2)
  2. len(list1, list2)
  3. max(list1, list2)
  4. min(list1, list2)

15. Out if list and tuples which are mutable ?

  1. tuples
  2. list
  3. both are mutable
  4. none of the above

16. What is the following function inserts an object at given index in a list?

  1. list.index(obj)
  2. list.insert(index, obj)
  3. list.pop(obj=list[-1])
  4. list.remove(obj)

17. What is the name of data type for character in python ?

  1. chr
  2. char
  3. character
  4. python do not have any data type for characters they are treated as string.

18. In python which is the correct method to load a module ?

  1. include math
  2. import math
  3. #include math.h
  4. using math
Tags

MCQ Multiple Choice Questions and Answers on Python

Python Question and Answer