Вы находитесь на странице: 1из 4

Subject: Computer Science CLASS -XII M.

Marks: 70
Date: Duration :
Name of the Student: ___________________________________________ Roll No:
________________________________________________________________________________________________________________________

Question Question. Marks


no.
1 a) What is difference between a keyword and an identifier? 2
b) What are data types? Mention Python’s built in core data types. 3
c) Rewrite the code after correcting the Syntax Errors 2

d) Which of the following are valid operators in Python: (i) ** (ii) */ 1


(iii) || (iv) is
e) Write the output of the Following Program 2

2 a) Write down the difference between list an string 2


b) Write a program that takes a string with multiple with multiple words and then
capitalises the first letter of each word and forms a new string out of it.
3
b) Write a program that creates a username and password using dictionary, and logs in and
displays “successfully logged in” if entered correct username-password pair or else
prints “Login Unsuccessful” if entered incorrect username-password.
c) Write any 2 Tuple Function with their appropriate Syntax and suitable example. 2
d) What does update () method does in dictionary. Give a suitable example 1
e) 2

What will be the output if we the input as


i. aabbcc
ii. aaccbb
3. a) What is the built in variable of python that stores _main_ name 1
b) 2

Plot the flow of execution of the above program


c) What are the two different scope a variable can have in a program during its course of
explain? Explain both of them briefly with help of a suitable example.
Or 4
c) Which rule is used as Name Resolution for Resolving Scope of a name? Explain briefly
with suitable example
d) 3

Identify these parts of the above program


i. Function header
ii. Function call
iii. Arguments
iv. Parameters
v. Function body
vi. Main program
e) 3

Trace the execution of the code and predict output produced by it.
f) What is the significance of having a function in a program? 2
4. a) Mention any three python libraries that cab ne used in python programming and explain 3
them briefly
b) Identify the module which you’ll need to import in order to use the following function
i. request.urlopen(<URL>)
ii. randint(a,b)
Or 1
b) What is the difference random() and randint()?
c) Write the syntax to import 3
i. Single Object
ii. Multiple Object
iii. All objects
From a module with relevant examples
d) What is the difference between int() and round() functions, how are they used? Explain with 2
proper syntax and relevant examples
e) What are docstring? What is their significance? Give example to support your answer.
Or 2
f) What is a package? How is a package different from module?
g) What is the problem in the following code? 1
from math import factorial
print (math.factorial(5))
h) What is the procedure to create own library or package in python? 3
5 a) What is a recursive Function? Write one advantage of recursive functions. 2
b) What is a base case?
Or 1
b) What is a recursive case?
c) Which function is considered slower, recursive or iterative? Explain briefly? 2
d) 2

Identify the base case(s) and recursive case in the code.


e) 3

Figure out the error in this program and suggest a solution.


f) Write a recursive code to Compute GCD of the given no.
OR 3
f) Write a recursive code to display the Fibonacci series of the number till the nth given input
6) a) What is a Network? Why is it needs? 2
b) What is the difference between working of switches and routers? 2
c) What is NIC? 2
e) Govt. Of Delhi have computer networks inside each of its buildings. It has now 1
interconnected the networks of Administration building and student center building. The
networks so formed are marked below as numbers. Mention which type of network is each
one of these.

Вам также может понравиться