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

Xii CS Ut-I

Uploaded by

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

Xii CS Ut-I

Uploaded by

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

UNIT TEST -I

(MAY 2024)
Computer Science (083) -XII
Time: 1: 15 Hours Max Marks: 25

General instructions:

Pleasecheck this questionpaper contains 9 questions.


The paper is divided into 3 Sections- A, B and C
Section A,consists of 5questions(1 to 5). Each questioncarries 1 Mark.
SectionB, consists of 4 questions (6 to 9). Each questioncarries 2 Marks.
SectionC, consists of 4 questions(10to 13). Each question carries 3 Marks.

programming questionsare to be answered using Python Language


All only

SECTIONA

1
1. Which is the correct form of declaration of adictionary?

a) Day {1; 'Monday,2;Tuesday', 3;Wednesday)


b) Day =[1: Monday',2:Tuesday', 3:Wednesday']
c) Day ={1: 'Monday', 2:"Tuesday, 3:Wednesday')
d) Day -[1; Monday',2;Tuesday', 3,Wednesday']

2. What will be the output of the following Python code?

=
TP (12,15,80)
TP1 -TP*3
print(TP1)

3.
Which of the following functions removes allleading and trailing space from a string?
a) Istrip) b) rstrip() c) Irstrip() d) strip) 1

4. What is the output of the following code? 1

a=[None]*10
print(len(a))
print(a)

5. Which of the following expression is an example of type casting?


a) 8.0 + float(5) b) 8.2+7.1 c) 15.0 +3 d) int(9.2) *3 1

SECTION B

6. What are data types?What are Python's 2


built-in data types?

7. What are immutableand mutable types? Lits immutableand mutable types of Python.
2
1
8. What is the role of comments and indentation in a program? 2
9
Predict the output of the following code fragment: 2

for NAME in ('ohn','Anuj', 'Mona', 'Preeti', Tarun']:


print(NAME)

if NAME[O] == M':
break

else:

print('Finished!')
print('Got it!")

10. Explain the use of pass statement. llustrate it with an example. 3

SECTION C

11. Differentiate between break and continue statements with suitable example/code 3

12. Differentiate between for and while loop with suitable example/code. 3

13. Write Python program to perform the following: 3


i) To check whether the given number is prime or not.
i) To display pattern like:

5
5 4
5 4 3
5 43 2
5 4 3 2 1

You might also like