On This Page

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

Q1 | )
  •   -12345.0 (5 blank spaces before the number)
  • -12345.0
  • error
  • -12345.000000000…. (infinite decimal places)
Q2 | Which of the following functions will not result in an error when no arguments are passed to it?
  • min()
  • divmod()
  • all()
  • float()
Q3 | )
  • f
  • 0xf
  • 0xf
  • 0xf
Q4 | Which of the following functions does not throw an error?
  • ord()
  • ord(‘ ‘)
  • ord(”)
  • ord(“”)
Q5 | , 4, 6])
  • 4
  • 3
  • error
  • 6
Q6 | ) oct(‘7’)
  • error 07
  • 0o7 error c) 0o7 error d)
  • 07
  • 0o7
Q7 | 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
Q8 | Which keyword is used for function?
  • fun
  • define
  • def
  • function
Q9 | printMax(3, 4)
  • 3
  • 4
  • 4 is maximum
  • none of the mentioned
Q10 | print(maximum(2, 3))
  • 2
  • 3
  • the numbers are equal
  • none of the mentioned
Q11 | 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
Q12 | Which are the advantages of functions in python?
  • reducing duplication of code
  • decomposing complex problems into simpler pieces
  • improving clarity of the code
  • all of the mentioned
Q13 | What are the two main types of functions?
  • custom function
  • built-in function & user defined function
  • user function
  • system function
Q14 | Where is function defined?
  • module
  • class
  • another function
  • all of the mentioned
Q15 | What is called when a function is defined inside a class?
  • module
  • class
  • another function
  • method
Q16 | Which of the following refers to mathematical function?
  • sqrt
  • rhombus
  • add
  • rhombus
Q17 | print x
  • 9
  • 3
  • 27
  • 30
Q18 | print z(8)
  • 48
  • 14
  • 64
  • none of the mentioned
Q19 | Does Lambda contains return statements?
  • true
  • false
Q20 | Lambda is a statement.
  • true
  • false
Q21 | Lambda contains block of statements.
  • true
  • false
Q22 | f(2, 30, 400)
  • 432
  • 24000
  • 430
  • no output
Q23 | who('Arthur')
  • arthur sir
  • sir arthur
  • arthur
  • none of the mentioned
Q24 | min(101*99, 102*98)
  • 9997
  • 9999
  • 9996
  • none of the mentioned
Q25 | What is a variable defined outside a function referred to as?
  • a static variable
  • a global variable
  • a local variable
  • an automatic variable