Class 12 Term-1
Class 12 Term-1
10 You can also create your own functions, these functions are called?
a) built-in functions b) user-defined functions
c) py function d) None of the above
11 To include the use of functions which are present in the random library, we
must use the option:
a) import random b) random.h c) import.random d) random.random
12 …………function will return the largest integer less than the given floating
point number.
a) floor() b) ceil() c) sqrt() d) CEIL()
13 .………..function returns the length of the object being passed.
a) Length() b) Len() c) len() d) count()
14 What is the value returned by following function
>>> math.floor(-3.4)
a) 3 b) -4 c) 4.0 d) 3.0
15 What keyword is used to define a python function?
a) import b) del c) def d) random
Q.N Section-B
1 What will be the output of the following Python code?
x = 50
def func(x):
print('x is', x)
x=2
print('Changed local x to', x)
func(x)
print('x is now', x)
x = 50
def func():
global x
print('x is', x)
x=2
print('Changed global x to', x)
func()
print('Value of x is', x)
Q.N Section-C
.
1 What are the advantages of using a function?
2 Explain Types of function.
3 Define python Function with example
4 Explain the flow of execution of a python Program with an example.
Q.N Section-D
.
1 What is the Scope of Variable in a python function? Explain GLOBAL, LOCAL and
NONLOKAL keywords with example.
2 Write a short note on
i) Parameters / Arguments Passing
ii) return value
3 Explain the following terms:
i) Pass by Value
ii) Pass by Reference
Best of Luck!