On This Page

This set of Problem Solving and Python Programming Multiple Choice Questions & Answers (MCQs) focuses on Problem Solving And Python Programming Set 9

Q1 | Which of the following functions does not necessarily accept only iterables as arguments?
  • enumerate()
  • all()
  • chr()
  • max()
Q2 | Which of the following functions accepts only integers as arguments?
  • ord()
  • min()
  • chr()
  • any()
Q3 | Suppose there is a list such that: l=[2,3,4]. If we want to print this list in reverse order, which of the following methods should be used?
  • reverse(l)
  • list(reverse[(l)])
  • reversed(l)
  • list(reversed(l))
Q4 | )
  •   -12345.0 (5 blank spaces before the number)
  • -12345.0
  • error
  • -12345.000000000…. (infinite decimal places)
Q5 | Which of the following functions will not result in an error when no arguments are passed to it?
  • min()
  • divmod()
  • all()
  • float()
Q6 | )
  • f
  • 0xf
  • 0xf
  • 0xf
Q7 | Which of the following functions does not throw an error?
  • ord()
  • ord(‘ ‘)
  • ord(”)
  • ord(“”)
Q8 | , 4, 6])
  • 4
  • 3
  • error
  • 6
Q9 | Which of the following is the use of function in python?
  • functions are reusable pieces of programs
  • functions don’t provide better modularity for your application
  • you can’t also create your own functions
  • all of the mentioned
Q10 | Which keyword is used for function?
  • fun
  • define
  • def
  • function
Q11 | printMax(3, 4)
  • 3
  • 4
  • 4 is maximum
  • none of the mentioned
Q12 | print(maximum(2, 3))
  • 2
  • 3
  • the numbers are equal
  • none of the mentioned
Q13 | Which of the following is a feature of DocString?
  • provide a convenient way of associating documentation with python modules, functions, classes, and methods
  • all functions should have a docstring
  • docstrings can be accessed by the     doc      attribute on objects
  • all of the mentioned
Q14 | What are the two main types of functions?
  • custom function
  • built-in function & user defined function
  • user function
  • system function
Q15 | Where is function defined?
  • module
  • class
  • another function
  • all of the mentioned
Q16 | What is called when a function is defined inside a class?
  • module
  • class
  • another function
  • method
Q17 | Which of the following is the use of id() function in python?
  • id returns the identity of the object
  • every object doesn’t have a unique id
  • all of the mentioned
  • none of the mentioned
Q18 | Which of the following refers to mathematical function?
  • sqrt
  • rhombus
  • add
  • rhombus
Q19 | print x
  • 9
  • 3
  • 27
  • 30
Q20 | Python supports the creation of anonymous functions at runtime, using a construct called
  • lambda
  • pi
  • anonymous
  • none of the mentioned
Q21 | print z(8)
  • 48
  • 14
  • 64
  • none of the mentioned
Q22 | Does Lambda contains return statements?
  • true
  • false
Q23 | Lambda is a statement.
  • true
  • false
Q24 | Lambda contains block of statements.
  • true
  • false
Q25 | f(2, 30, 400)
  • 432
  • 24000
  • 430
  • no output