Class XI CS Worksheet - I 2025
Class XI CS Worksheet - I 2025
I Find error in the following code (if any) and correct code by rewriting code and
underline the correction;‐
1. a, b = 0
If (a=b)
a+b = c
Print c
2. The following code has two dictionaries with tuple as keys, While one of these
dictionaries being successfully created, the other is giving some error. Find out
which dictionary will be created successfully and which one will give error and
correct it.
D1 = {(1,2) : [1, 2], (3, 4) : [5, 6] }
D2 = {( [[1], [2] ) : [1, 2], ( [3], [4]) : [5, 6] }
5. Which of the function return the smallest integer not less than number.
a) exp() b) ceil() c) floor() d) fabs()
7.Out of the following, which function should we use to generate random numbers
between 1 and 5 ?
a) random() b) randint() c) range() d) generate()
a) IndexError
b) A random day from all the seven days
c) A random day from all the days except Sunday
d) A random days from all the days except monday
ii)word = 'CatBatSatFatOr'
print(word.split('t'))
17. Amir plays a string game. He wants to display last four characters of string
object s. Which of the following statements are true?
a) s[4:] b) s[:4] c) s[-4:] d) s[:-4]