Class 12 Working with Functions MCQ Quiz | Functions in Python class 12 MCQ Quiz

Preview

Class 12 Working with Functions MCQ Quiz | Functions in Python class 12 MCQ Quiz



0%

Class 12 Working with Functions Quiz

1 / 26

What is a variable defined inside a function referred to as ?

2 / 26

A Python function can't return more than one value.

3 / 26

Variables defined inside functions can have global scope .

4 / 26

What is a variable defined outside all the functions referred to as ?

5 / 26

What is the default value for a function that does not return any value explicitly ?

6 / 26

A parameter having default value in the function header is known as a default parameter .

7 / 26

Pick one the following statements to correctly complete the function body in the given code snippet.

def  f (number) :

# Missing function body

print (f (5) )

8 / 26

Which of the following items are present in the function header ?

9 / 26

In Python, the program execution begins with first statement of __main__ segment .

10 / 26

What is the result of this code ?

def print_double (x) :

print ( 2 ** x )

print_double (3)

11 / 26

Which of the following function calls will cause Error while invoking the below function definition ?

  def test ( a , b, c, d )

12 / 26

What is the order of resolving scope of a name in a Python program ?

(L : Local namespace, E : Enclosing namespace, B : Built-In Namespace, G : Global namespace )

13 / 26

The default values for parameters are considered only if no value is provided for that parameter in the function call statement .

14 / 26

Carefully observe the code and give the answer .

def  function (a) :

a = a + ‘1’

a = a / 2

>>>function ( “hello” )

15 / 26

Which of the following function headers is correct ?

16 / 26

A local variable having the same name as that of a global variable, hides the global variable in its function .

17 / 26

Which of the following function calls can't be used to invoke the below function  definition ?

def test ( a,b,c,d )

18 / 26

The first line of function definition that begins with keyword def and ends with a colon ( : ), is also known as function header .

19 / 26

Which of the given argument types can be skipped from a function call ?

20 / 26

Which of the following statements is not true for parameter passing to functions ?

21 / 26

A function can also return multiple values .

22 / 26

Variables that are listed within the parentheses of a function header are called function variables .

23 / 26

Which of the following keywords marks the beginning of the function block ?

24 / 26

Default parameters cannot be skipped in function call .

25 / 26

What is the name given to that area of memory, where the system stores the parameters and local variables of a function call ?

26 / 26

Non-default arguments can be placed before or after a default argument in a function definition .



 

Spread the love
Lesson tags: Class 12 Working with Functions MCQ, Class 12 Working with Functions Quiz, python quiz for class 12, Working with Functions in Python MCQ
Back to: CBSE class 12 Computer Science notes
Spread the love