Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Sunbeam Suncity (School & Hostel)

CLASS – XI
COMPUTER SCIENCE
WORKSHEET-II (2022-2023)
UNIT –II : Programming and Computational Thinking –I

1. Which of the following option is not a core data type in the python language?
a)Dictionary
b)Lists
c)Class
d) All of the above

2. l = [ 4, 8, 9, 2.6, 5 ] is a type of which data type in python?


a) List
b) Tuple
c) Set
d) None of these
3. How can we create an empty list in python?
a) list=()
b) null
c) list
d) list=[]
4. Which statement is true from following-
a) List is mutable & Tuple is immutable
b) List is immutable & Tuple is mutable
c) Both are Mutable.
d) Both are Immutable
5. Identify tuple from the following-
a) [3]
b) {1, 2, 3}
c) (1, 2, 3, 4)
d) None of the Above
6. Which of the following is/are incorrect ways of creating strings ?
a) name = Jiya
b) name = „Jiya‟
c) name = “Jiya”
d) name = “(Jiya)”
7. The input( ) returns the value as ………. type.
a) integer
b) string
c) floating point
d) none of these
8. What will be the output of this code:
num = 2

while(num<=20):

num = num + 2

print(num)

a) 20
b) 18
c) 22
d) 2

9. What will be the output of this code:


num = 2

while(num<=20):

break

num = num + 2

print(num)

a) 20
b) 18
c) 22
d) 2

10. What will be the output of this code:


L=[12,14,65,32,11]
print L[-2:]
print L[2:4]
a) [32, 11]
[65, 32]
b) [14, 65]
[65, 32]
c) [32, 65]
[65, 32]
d) [11, 32]
[65, 32]
11. Write a short note on string constructs in python.
12. Name the jump statements in python. Explain with example.
13. Distinguished between break and continue statement.
14. Define the following terms:
a) Infinite loop (endless loop) b) Entry controlled loop
15. What will be the output of the following functions:
a) range(1,10) b) range(1,10,2)
16. What is the difference between (30) and (30,)?
17. Write a program to find the largest among three given numbers.
18. Due to some logical error following code contains endless loop. Rewrite the code by making
correction so that loop may produce proper output. (Underline the error)
n=10
answer=1
while (n>=10):
answer= answer + n**2
n=n+1
print(“answer”)
19. Write a program to print the grade of the students as per the input percentage as per the
criteria given below
If percentage between 91-100 Grade “A+”
If percentage between 81-90 Grade “A”
If percentage between 71-80 Grade “B+”
If percentage between 61-70 Grade “B”
If percentage between 41-50 Grade “D”
If percentage between 0-40 Grade “E”
20. What is the significance of loop/Iterative statement? Explain the various loop with syntax and
example available in python.

You might also like