0% found this document useful (0 votes)
12 views

Function_Unit_Test

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Function_Unit_Test

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

GSBV, BURARI, UNIT TEST – 01

CLASS 12 (COMPUTER SCIENCE)


Q1: What will be the output of the following Q9: Find and correct the error from the following
statement? 1 code: 4

print(16*5/4*2/5-8) def even(n)


(a) -3.33 if n // 2 = 0
(b) 0.0
(c) 6.0 print(“Even”)
(d) -13.33 else
Q2: Which keyword is used to define a function? 1 print(“Odd”)
(a) define a = int(input(“Enter a number”)
(b) def
(c) create even(n)
(d) declare
Q10: Write statement to call the function. 1
Q3: By default a function return -------- 1
def add(x,y):
(a) None
z=x+y
(b) NULL
(c) False print(z)
(d) True
------------------------- #statement to call the function
Q4: Which of the following is NOT a built-in function
of Python? 1 Q11: Write the output of the following code: 3

(a) int() def Cube(n):


(b) eval()
print(n*n*n)
(c) input()
(d) calculate_sqrt_number() n=10

Q5: Which of the following function header is Cube(n)


correct? 1
print(Cube(n))
(a) def add(p=100, r, t=2):
Q12: What is argument? Explain different types of
(b) def add(p=100, r=8, t):
arguments. 2
(c) def add(p, r=8, t):
(d) def add(p, r=8, t=2):

Q6: In Python, can a function return multiple values


simultaneously? (True/False) 1

Q7: The order of keyword arguments does not matter,


as they are matched to the function parameters based
on their names. (True/False) 1

Q8: Write the name of 2-2 functions of math, random


and statistics module. 3

S P SHARMA SIR LECTURER COMPUTER SCIENCE Unit Test - 1

You might also like