0% found this document useful (0 votes)
12 views6 pages

CS 083 RT 4 MAT CS Final

Cs qp use it

Uploaded by

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

CS 083 RT 4 MAT CS Final

Cs qp use it

Uploaded by

Mishku
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

BHARATH VIDYA MANDIR

REVISION TEST IV
COMPUTER SCIENCE (083)

DATE: 18.11.2023 MARKS: 80


CLASS: XII MAT-CS DURATION: 180 MINS
General Instructions:
1. This question paper contains five sections, Section A to E.
2. All questions are compulsory.
3. Section A has 18 questions carrying 01 mark each.
4. Section B has 7 Very Short Answer type questions carrying 02 marks each.
5. Section C has 5 Short Answer type questions carrying 3 marks each.
6. Section D has 2 questions carrying 04 marks each.
7. Section E has 3 question carrying 05 marks each.

SECTION A (40 MINS) (18*1 = 18 MARKS)

1) Which keyword is used for function?


a) fun b) define c) def d) function
2) Which operator is used in Python to import modules from packages?
a) . b) * c) -> d) &
3) Which is a type of function?
a) custom b) build in c) main d) system
4)Which argument is also called as positional arguments?
a) keyword b) default c) required d) variable length
5)_____ is used after name of functions.
a) [] b){} c) () d) <>
6)Which of the following function headers is correct?
a) def fun(a = 2, b = 3, c) b) def fun(a = 2, b, c = 3)
c) def fun(a, b = 2, c = 3) d) def fun(a, b, c = 3, d)
7) Which one of the following is the correct way of calling a function?
a) function_name() b) call function_name()
c) ret function_name() d) function function_name()
8) The end from which elements are added or deleted is called _________ of a stack.
a) end b) top c) bottom d) none
9) Trying to pop an element from an empty stack results into a special condition called________ .
a) overflow b) underflow c) fullflow d) full stack
10) Which of the following statement is a function call?
a) call sum() b)def sum() c)sum() d) function sum()
11) Pushing an element into stack already having five elements and stack size of 5, then stack
becomes_____.
a) overflow b)crash c) underflow d) user flow
12) Which of the following is an example of non primitive data structure?
a) array b) function c)stack d) all the above
13) What is n1? defcal(n1)
a) parameter b) argument c) keyword d) none of these
14) Which of the following functions helps us to randomize the items of a list?
a) seed b) randomize c) shuffle d) uniform
15) The randrange function returns only an integer value.
a) True b) False
16) What will be the output of the following Python code?random.randrange(1,100,10)
a) 32 b) 67 c) 91 d) 80
17) Entries in a stack are "ordered". What is the meaning of this statement?
a) A collection of stacks can be sorted.b) Stack entries may be compared with the <'operation.
c) The entries are stored in a linked list.d) There is a Sequential entry that is one by one.
18) What will be the output of the following Python code?
def function1(var1=5, var2=7):
var2=9
var1=3
print (var1, " ", var2)
function1(10,12)
a) 5 7 b) 3 9 c) 10 12 d) Error

SECTION B (30 MINS) (7*2 = 14 MARKS)

19) Mention the forms of importing python module statements.


20) Define global variable with an example program.
21) Mention the applications of stack
22) Define positional arguments with an example program.
23) Define modules.
24) Write short notes on function with its types.
25) Consider the following operation performed on a stack of size
Push(1);Pop();Push(2);Push(3);Pop();Push(4);Pop();Pop();Push(5);
Mention the number of elements present in stack after the completion of all operation.

SECTION C (50 MINS) (5*3 = 15 MARKS)

26) Write 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)
27) Write the algorithm for traversing stack elements.
28) Write the output of the following Python code?
a) S=”WELCOME”
def change(T):
T=”HELLO”
Print(T,end=’@’)
Change(S)
Print(S)
b) S=”GOOD MORNING”
Print(S.capitalize(),S.title(),end=”!”)
c) L=[‘a’,’b’,’c’,’d’]
print (“ ”.join(L))
29) Mention the basic operation of stack
30) Explain about abs(), eval(), str() functions.

SECTION D (20 MINS) (2*4 = 8 MARKS)

31) Write the output for the following code.


a) List1=[5,8,3,9,6,1]
Mention the List1 after List1.pop(2)
b) def fun1(name, age=20):
print(name, age)
fun1('Emma', 25)
c) def add(a, b):
return a+5, b+5
result = add(3, 2)
print(result)
d) What will be the output of the following Python code?
def sayHello():
print('Hello World!')
sayHello()
sayHello()
32) Briefly explain about the exception handling methods with example.

SECTION E (30 MINS) ( (3*5 = 15 MARKS)

33) Explain briefly about random module with example.


34) Explain briefly about exception with its types.
35) Fill the statements
total=_____ #line1
def sum(arg1,arg2)___ #line2
total=arg1+____ #line3
Print (total) #line4
return_____ #line5
total=sum(10,20) #line6
print(____) #line7
a) Which value or constant will be equal to variable total in line1?
b) Which symbol is used to terminate the function def in line2?
c) Fill the answers for line 3.
d) Which value will be return in line5?
e) Fill the answers for line 7.

(LAST 10 Mins for Checking)

PRACTICALS
SUBJECT CODE: CS083 SCHOOL CODE: 55474

MAX. TIME: 30 MINS QUESTIONS MAX MARKS: 10

1. SQL COMMANDS (Aggregate functions, Order by Group by, Having Clause).


2. SQL COMMANDS (Math Functions).
ANSWER KEY

SECTION A
1)Which keyword is used for function?
a) funb) definec) defd) function
2) Which operator is used in Python to import modules from packages?
a) . b) * c) -> d)&
3) Which is a type of function?
a)custom b)build in c)main d)system
4)Which argument is also called as positional arguments?
a) keyword b) default c) required d) variable length
5)_____ is used after name of functions.
a) [] b){} c) () d) <>
6)Which of the following function headers is correct?
a)def fun(a = 2, b = 3, c) b) def fun(a = 2, b, c = 3)
c)def fun(a, b = 2, c = 3)d) def fun(a, b, c = 3, d)
7) Which one of the following is the correct way of calling a function?
a)function_name()b) call function_name()
c) ret function_name()d) function function_name()
8) The end from which elements are added or deleted is called _________ of a stack.
a) endb)top c) bottom d) none
9) Trying to pop an element from an empty stack results into a special condition
called________ .
a) overflow b) underflow c) fullflow d) full stack
10) Which of the following statement is a function call?
a) call sum() b)def sum() c)sum() d) function sum()
11) Pushing an element into stack already having five elements and stack size of 5, then
stack becomes ___________
a) overflowb)crashc) underflowd) user flow
12) Which of the following is an example of non primitive data structure?
a) array b) function c) stackd) all the above
13) What is n1?
defcal(n1)
a) parameter b) argument c) keyword d) none of these
14) Which of the following functions helps us to randomize the items of a list?
a) seedb) randomisec) shuffled) uniform
15) The randrange function returns only an integer value.
a) Trueb) False
16)What will be the output of the following Python code?
random.randrange(1,100,10)
a) 32 b) 67 c) 91 d) 80

Explanation: The output of this function can be any value which is a multiple of 10, plus 1. Hence a value like 11,
21, 31, 41…91 can be the output. Also, the value should necessarily be between 1 and 100. The only option which
satisfies this criteria is 91.

17)Entries in a stack are "ordered". What is the meaning of this statement?


a) A collection of stacks can be sorted.
b) Stack entries may be compared with the <' operation.

c) The entries are stored in a linked list.


d) There is a Sequential entry that is one by one.
18)What will be the output of the following Python code?
def function1(var1=5, var2=7):
var2=9
var1=3
print (var1, " ", var2)
function1(10,12)
a) 5 7 b) 3 9 c. 10 12 d. Error

SECTION B

Answer the following questions (7 X 2=14)


19) Mention the forms of importing python module statements.
20) Define global variable with an example program.
21) Mention the applications of stack
22) Define positional arguments with an example program.
23) Define modules.
24) Write short notes on function with its types.
25) Consider the following operation performed on a stack of size 5
Push(1);
Pop();
Push(2);
Push(3);
Pop();
Push(4);
Pop();
Pop();
Push(5);
Mention the number of elements present in stack after the completion of all operation.
1

SECTION C

Answer the following questions (5 X 3=15)


26) Write the output of the following Python code?
x = 50
deffunc(x):
print('x is', x)
x=2
print('Changed local x to', x)
func(x)
print('x is now', x)

x is 50
Changed local x to 2
x is now 50
27) Write the algorithm for traversing stack elements.
28) Write the output of the following Python code?
a) S=”WELCOME”
def change(T):
T=”HELLO”
Print(T,end=’@’)
Change(S)
Print(S)
HELLO@WELCOME
b) S=”GOOD MORNING”
Print(S.capitalize(),S.title(),end=”!”)
Good morning!Good Morning!
c) L=[‘a’,’b’,’c’,’d’] print (“ ”.join(L))
abcd
29) Mention the basic operation of stack
30) Explain about abs(), eval(), str() functions.
SECTION D
Answer the following questions (3 X 5=15)
31) Explain briefly about random module.
32) Explain briefly about stack.
33)33) Fill the statements
total=_____ #line1
def sum(arg1,arg2)___ #line2
total=arg1+____ #line3
Print (total) #line4
return_____ #line5
total=sum(10,20) #line6
print(____) #line7
a)Which value or constant will be equal to variable total in line1?0
b)Which symbol is used to terminate the function def in line2? :
c)Fill the answers in line 3.arg2
d)Which value will be return in line5?total
e)Fill the answers for line 7.total

SECTION E
Answer the following questions (2 X 4=8)
34) Write the output for the following code.
a)List1=[5,8,3,9,6,1]
Mention the List1 after List1.pop(2)
[5,8,9,6,1]
b)def fun1(name, age=20):
print(name, age)
fun1('Emma', 25)
Emma 25
c)def add(a, b):
return a+5, b+5
result = add(3, 2)
print(result)
(8, 7)
d) What will be the output of the following Python code?
defsayHello():
print('Hello World!')
sayHello()
sayHello()
Hello World!

35) Consider the following sequence of numbers: 1,2,3,4


Stack produce the sequence as 2,1,4,3
List out the push and pop operations.
Push(1) push(2) pop(2) pop(1) push(3) push(4) pop(4) pop(3)

You might also like