0% found this document useful (0 votes)
25 views2 pages

Slip Test - Functions

CBSE CLASS 12 FUNCTIONS QUESTIONS

Uploaded by

gomathi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views2 pages

Slip Test - Functions

CBSE CLASS 12 FUNCTIONS QUESTIONS

Uploaded by

gomathi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

OXALISS INTERNATIONAL SCHOOL (CBSE),

THATCHUR.
Computer Science (083)
Class: XII Session: 2024-25
SLIP TEST – WORKING WITH FUNCTIONS
Date : 09.07.2024 Max. Marks: 20
SECTION – A
1. Which of the following function headers is correct? 1

a) def f(a = 1, b): b) def f(a = 1, b, c = 2):


c) def f(a = 1, b = 1, c = 2): d) def f(a = 1, b = 1, c = 2, d):
2. Which of the following statements is not true for parameter passing to functions ? 1
a) You can pass positional arguments in any order.
b) You can pass keyword arguments in any order.
c) You can call a function with positional and keyword arguments.
d) Positional arguments must be before keyword arguments in a function call.
3. Which of the following function calls can be used to invoke the below function 1
definition ?
def test(a, b, c, d)
a) Test(1, 2, 3, 4) b) Test(a = 1, 2, 3, 4)
c)Test(a = 1, b = 2, c = 3, 4) d) Test(a = 1, b = 2, c = 3, d = 4)
4. For a function header as follows : 1
def Calc(X,Y = 20):
Which of the following function calls will give an error ?

a) Calc(15, 25) b) Calc(X = 15, Y = 25) c) Calc(Y = 25)

OXALISS INTERNATIONAL SCHOOL (CBSE),


THATCHUR.
Computer Science (083)
Class: XII Session: 2024-25
SLIP TEST – WORKING WITH FUNCTIONS
Date : 09.07.2024 Max. Marks: 20
SECTION – A
1. Which of the following function headers is correct? 1

a) def f(a = 1, b): b) def f(a = 1, b, c = 2):


c) def f(a = 1, b = 1, c = 2): d) def f(a = 1, b = 1, c = 2, d):
2. Which of the following statements is not true for parameter passing to functions ? 1
a) You can pass positional arguments in any order.
b) You can pass keyword arguments in any order.
c) You can call a function with positional and keyword arguments.
d) Positional arguments must be before keyword arguments in a function call.
3. Which of the following function calls can be used to invoke the below function 1
definition ?
def test(a, b, c, d)
a) Test(1, 2, 3, 4) b) Test(a = 1, 2, 3, 4)
c)Test(a = 1, b = 2, c = 3, 4) d) Test(a = 1, b = 2, c = 3, d = 4)
4. For a function header as follows : 1
def Calc(X,Y = 20):
Which of the following function calls will give an error ?

a) Calc(15, 25) b) Calc(X = 15, Y = 25) c) Calc(Y = 25)


SECTION – B

5. Write the flow of execution for the following program 2


1. def sum(a, b, c, d):
2. result = 0
3. result = result + a + b + c + d
4. return result
5.
6. def length():
7. return 4
8.
9. def mean(a, b, c, d):
10. return float(sum(a, b, c, d))/length()
11.
12. print(sum(a, b, c, d), length()
6. Find the errors in code given below : 2
define check()
N = input('Enter N:')
i=3
answer = 1 + i ** 4 / N
Return answer

7. Write the difference between formal parameter and actual parameter. 2

SECTION – B
5. Write the flow of execution for the following program 2
1. def sum(a, b, c, d):
2. result = 0
3. result = result + a + b + c + d
4. return result
5.
6. def length():
7. return 4
8.
9. def mean(a, b, c, d):
10. return float(sum(a, b, c, d))/length()
11.
12. print(sum(a, b, c, d), length()
6. Find the errors in code given below : 2
define check()
N = input('Enter N:')
i=3
answer = 1 + i ** 4 / N
Return answer

7. Write the difference between formal parameter and actual parameter. 2

You might also like