12th SC UT 1 Python 2024-25
12th SC UT 1 Python 2024-25
UNIT TEST – 1
COMPUTER SCIENCE WITH PYTHON
TIME : 1:30 HOURS CLASS XII MAXIMUM MARKS 40
1. Aman wants to write a function in python. c) Statement A is correct but Statement B is not
But he doesn’t know how to start with it! correct
Select the keyword used to start a function out d) Both are incorrect
of the following:
a) function 7. Richa is working with a program where she
b) start gave some values to the function. She doesn’t
c) def know the term to relate these values. Help her
d) fun by selecting the correct option.
a) function value
2. Which of the following is a valid function b) arguments or parameters
name? c) return values
a) start_game() d) function call
b) start game()
c) start-game() 8. Mohini wants to know that the symbol:
d) All of the above (colon) must be required with which of the
following function part?
3. Which of the following is not a part of the a) function header
python function? d) function body
a) function header c) return statement
b) return statement d) parameters
c) parameter list
d) function keyword 9. Which of the function part contains the
instructions for the tasks to be done in the
4. The function header contains function?
a) function name and parameters only a) function header
b) def keyword along with function name and d) function body
parameters c) return statement
c) return statement only d) parameters
d) parameter list only
10. Ananya is trying to understand the features
5. The subprogram that acts on data and of python functions. She is not understanding
returns the value sometimes is known as the feature that distributes the work in small
a) Function parts. Select the appropriate term for her out
b) Module of the following:
c) Class a) Modularity
d) Package b) Reusability
c) Simplicity
6. Read the statements: d) Abstraction
Statement (A) : A function can perform certain
functionality 11. Which of the following is not a feature
Statement (B) : A function must return a result supported by python functions
value a) Modularity
a) Statement A is correct b) Reusability
b) Statement B is correct c) Simplicity
d) Data Hiding 14. Which of the following sentence is not
correct for the python function?
12. Divya wants to print the identity of the a) Python function must have arguments
object used in the function. Which of the b) Python function can take an unlimited
following function is used to print the same? number of arguments
a) identity() c) Python function can return multiple values
b) ide() d) To return value you need to write the return
c) id() statement
d) idy()
15. Pranjal wants to write a function to
13. Rashmin is learning the python functions compute the square of a given number. But he
He read the topic types of python functions. He missed one statement in the function. Select
read that functions already available in the the statement for the following code:
python library is called ___________. Fill def sq(n):
appropriate word in this blank : ____________
a) UDF (User Defined Function) print(sq(3))
b) Built-in Functions a) return square of n
c) Modules b) return n**2
d) Reusable Function c) return n
d) print(“n**n”)
Q.17- Write a program in Python using function to calculate the simple interest. 5
Q.18- What is the difference between the formal parameters and actual parameters? What are their
alternative names? Also, give a suitable Python code to illustrate both. 5
Q.19- What is the difference between a local variable and a global variable? Also, give a suitable
Python code to illustrate both. 4
Q.20- Which names are local, which are global and which are built-in in the following code fragment?
invaders = ”Big names” 4
pos = 200
level = 1
def play():
max_level = level + 10
print(len(invaders) == 0)
return max_level
res = play()
print(res)
Q.21- Write a function EOReplace() in Python, which accepts a list L of numbers. Thereafter, it increments all
even numbers by 1 and decrements all odd numbers by 1. 3
Example:
If Sample Input data of the list is:
L=[10,20,30,40,35,55]
Output will be :
L=[11,21,31,41,34,54]