Multiple Choice Questions - Functions

Description

Quiz on Multiple Choice Questions - Functions, created by Aparna Dhirde on 03/15/2020.
Aparna Dhirde
Quiz by Aparna Dhirde, updated more than 1 year ago
Aparna Dhirde
Created by Aparna Dhirde over 4 years ago
110
0

Resource summary

Question 1

Question
Which keyword is use for function?.
Answer
  • define
  • fun
  • def
  • function

Question 2

Question
Which of the following items are present in the function header?.
Answer
  • function name
  • parameter list
  • return value
  • Both A and B

Question 3

Question
If return statement is not used inside the function, the function will return:.
Answer
  • None
  • 0
  • Null
  • Arbitary value

Question 4

Question
Which of the following function headers is correct?.
Answer
  • def fun(a = 2, b = 3, c)
  • def fun(a = 2, b, c = 3)
  • def fun(a, b = 2, c = 3)
  • def fun(a, b, c = 3, d)

Question 5

Question
Which of the following is the use of function in python?
Answer
  • 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

Question 6

Question
Which of the following is a feature of DocString?
Answer
  • 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

Question 7

Question
What is the default return value for a function that does not return any value explicitly?
Answer
  • None
  • int
  • double
  • public
  • null

Question 8

Question
Which of the following items are present in the function header?
Answer
  • function name
  • function name and parameter list
  • parameter list
  • return value

Question 9

Question
Which of the following enclose the input parameters or arguments of a function?
Answer
  • brackets
  • parentheses
  • curly braces
  • quotation marks

Question 10

Question
What will be the output of the following Python code?. def function1(var1=5, var2=7): var2=9 var1=3 print (var1, " ", var2) function1(10,12)
Answer
  • 5 7
  • 3 9
  • 10 12
  • Error

Question 11

Question
print type(type(int))
Answer
  • type 'int'
  • type 'type'
  • Error
  • 0
Show full summary Hide full summary

Similar

Know the principles of electricity
Vito Martino
Creative Writing
amberbob27
History of Psychology
mia.rigby
English Poetry Key Words
Oliviax
Key word flashcards
I M Wilson
GCSE Maths: Geometry & Measures
Andrea Leyden
GCSE Computing: Hardware
Yasmin F
Business Studies - AQA - GCSE - Types of Ownership
Josh Anderson
Theory of Knowledge Essay Preparation
Derek Cumberbatch
I wish I..
Cristina Cabal
Rossetti Links
Mrs Peacock