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

Click here to learn basics of  Python

1 / 26

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

2 / 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 )

3 / 26

Variables defined inside functions can have global scope .

4 / 26

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

5 / 26

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

def test ( a,b,c,d )

6 / 26

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

7 / 26

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

8 / 26

Default parameters cannot be skipped in function call .

9 / 26

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

10 / 26

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

11 / 26

What is the result of this code ?

def print_double (x) :

print ( 2 ** x )

print_double (3)

12 / 26

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

13 / 26

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

14 / 26

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

15 / 26

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

16 / 26

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

17 / 26

A function can also return multiple values .

18 / 26

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

  def test ( a , b, c, d )

19 / 26

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

20 / 26

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

21 / 26

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

22 / 26

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

23 / 26

Carefully observe the code and give the answer .

def  function (a) :

a = a + ‘1’

a = a / 2

>>>function ( “hello” )

24 / 26

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

25 / 26

Which of the following function headers is correct ?

26 / 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) )



 

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