[go: up one dir, main page]

0% found this document useful (0 votes)
45 views4 pages

Class 12 Term-1

Uploaded by

PreeT Vithule
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)
45 views4 pages

Class 12 Term-1

Uploaded by

PreeT Vithule
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
You are on page 1/ 4

PM SHRI JAWAHAR NAVODAYA VIDYALAYA CHANDRAPUR

Class: XII Session: 2024-25


Computer Science (Code 083)
(Theory: Term-1)
Maximum Marks: 40 Time Allowed: 90 Minutes
--------------------------------------------------------------------------------------------------
General Instructions:

• The question paper is divided into 4 Sections - A, B , C and D.


• Section A, consist of 15 Question (1-15). Attempt any 13 questions. 01 Mark each.
• Section B, consist of 6 Questions (16-22). Attempt any 5 questions. 02 Mark each.
• Section C, consist of 4 Questions (22-26). Attempt any 3 questions. 03 Mark each.
• Section C, consist of 3 Questions (26-28). Attempt any 2 questions. 04 Mark each.

Q.N Section-A
.
1 Which of the following is the use of function in python?
a) Functions are reusable pieces of programs
b) Functions don’t provide better modularity for your application
c) you can’t also create your own functions
d) All of the mentioned
2 Name the statement that sends back a value from a function.
a) print b) input c) return d) None
3 What is a variable defined inside a function referred to as?
a) A global variable b) A local variable
c) A volatile variable d) An automatic variable

4 The built-in function sin() belongs to which module:


a) random b) pandas c) math d) numpy
5 Given a function that does not return any value, What value is thrown by
default when executed in shell.
a) int b) bool c) void d) None

6 Which of the following statements is correct for variable names in Python


language?
a) All variable names must begin with an underscore.
b) Unlimited length
c) The variable name length is a maximum of 2.
d) All of the above
7 Which of the following functions is a built-in function in python language?
a) val() b) printf() c) print() d) None of these
8 Which of the following items are present in the function header?
a) function name b) parameter list c) return value d) Both a and b
9 How is a function declared in Python?
a) def function function_name(): b) declare function function_name():
c) def function_name(): d) declare function_name():

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?

def printMax(a, b):


if a > b:
print(a, 'is maximum')
elif a == b:
print(a, 'is equal to', b)
else:
print(b, 'is maximum')
printMax(3, 4)
2 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)

3 What will be the output of the following Python code?

def say(message, times = 1):


print(message * times)
say('Hello')
say('World', 5)

4 What will be the output of the following Python code?

def func(a, b=5, c=10):


print('a is', a, 'and b is', b, 'and c is', c)
func(3, 7)
func(25, c = 24)
func(c = 50, a = 100)
5 What will be the output of the following Python code?

def maximum(x, y):


if x > y:
return x
elif x == y:
return 'The numbers are equal'
else:
return y
print(maximum(2, 3))
6 What will be the output of the following Python code?

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!

You might also like