SL 6 Cs
SL 6 Cs
VELLANUR
SLIP TEST-6
CLASS: XII
MARKS:50
SUBJECT:COMPUTER SCIENCE [083]
DATE:9.08.24
__________________________________________________________________
______________
1. Which of the following is an invalid variable?
1. my_day_2 2. 2nd_day 3. Day_two 4. _2
2. Which of these is not a core data type?
1. Lists 2. Dictionary 3. Tuples 4. Class
3. What will be the value of the expression? 14 + 13 % 15
1. 14 2. 27 3. 12 4. 0
4. Evaluate the expression given below if A = 16 and B = 15. A % B // A
1. 0.0 2. 0 3. 1.0 4. 1
5. Which among the following list of operators has the highest precedence? +, -,
**, %, /, <>, |
1. <> 2. ** 3. I 4. %
6. Which value type does input () return ?
1. Boolean 2. String 3. Int 4. Float
7. Which of the following four code fragments will yield following output?
Eina
Mina
Dika S
Select all of the function calls that result in this output
1|Page
1. print('''Eina\nMina\nDika''') 2. print('''EinaMinaDika''')
3. print('Eina\nMina\nDika') 4. print('EinaMinaDika')
8. Predict the output of the following code fragments:
count = 0
while count < 10:
print ("Hello")
count += 1
9. for Name in ['Jayes', 'Ramya', 'Taruna', 'Suraj'] :
print (Name)
if Name[0] == 'T' :
break else :
print ('Finished!')
print ('Got it!')
10. What the does random. Seed(3) return?
a) True b) None c) 3 d) 1
11. Which of the following is equivalent to random.randrange(3)?
a) range(3) b) random.choice(range(0, 3))
c) random.shuffle(range(3)) d) random.select(range(3))
12. def test(i,j):
if(i==0):
return j
else:
return test(i-1,i+j)
print(test(4,7))
a) 13 b) 7 c) Infinite loop d) 17
2|Page
13. For a given declaration in Python as s = "WELCOME", which of the
following will be the correct output of print(s[1::2])?
1. WEL
2. COME
3. WLOE
4. ECM
17. A ______________ statement skips the rest of the loop and jumps over to the
statement following the loop
18. The _________ statement skips the rest of the loop statements and causes the
next iteration of the loop to take place.
True/False Questions
19. The value of the expressions 4/(3*(2 - 1)) and 4/3*(2 - 1) is the same.
21. In a nested loop, a break statement terminates all the nested loops in one go
24. Following set of commands is executed in shell, what will be the output?
3|Page
>>>str = "hello"
>>>str[:2]
>>>
1. list
2. dictionary
3. array
4. tuple
String1 = "my"
String2 = "work"
print(String1+String2.upper())
What is the output of this code?
1. Line 3
2. Line 2
3. Line 4
4. Line 1
4|Page
29. Which is the correct form of declaration of dictionary ?
30. Suppose a tuple T is declared as T = (10, 12, 43, 39), which of the following
is incorrect ?
1. print(T[1])
2. T[2] = -29
3. print(max(T))
4. print(len(T))
31. Write a python script that traverses through an input string and prints its
characters in different lines - two characters per line.
32. Write a Python statement to declare a Dictionary named ClassRoll with Keys
as 1, 2, 3 and corresponding values as 'Reena', 'Rakesh', 'Zareen' respectively.
y = str(123)
x = "hello" \* 3
print(x, y)
x = "hello" + "world"
y = len(x)
print(y, x)
34. What will be the output produced by following code fragments ?
x = "hello" + \
"to Python" + \
"world"
for char in x :
y = char
print(y, ':', end=" ")
35. What will be the output produced by following code fragments ?
x = "hello world"
print(x[:2], x[:-2], x[-2:])
5|Page
print(x[6], x[2:4])
print(x[2:-3], x[-4:-2])
36. Predict the output of the following code snippet ?
a = [1, 2, 3, 4, 5]
print(a[3:0:-1])
37. Predict the output of the following code snippet?
arr = [1, 2, 3, 4, 5, 6]
for i in range(1, 6):
arr[i - 1] = arr[i]
for i in range(0, 6):
print(arr[i], end = "")
38. Predict the output of the following code snippet ?
(a, b, c, d) = ntpl
print("a is:", a)
print("b is:", b)
print("c is:", c)
print("d is:", d)
ntpl = (a, b, c, d)
print(ntpl[0][0] + ntpl[1][1], ntpl[1])
42. What will be the output of the following code snippet ?
6|Page
rec = {"Name" : "Python", "Age" : "20", "Addr" : "NJ", "Country" : "USA"}
id1 = id(rec)
del rec
rec = {"Name" : "Python", "Age" : "20", "Addr" : "NJ", "Country" : "USA"}
id2 = id(rec)
print(id1 == id2)
43. What will be the output of the following code snippet ?
my_dict = {}
my_dict[(1,2,4)] = 8
my_dict[(4,2,1)] = 10
my_dict[(1,2)] = 12
sum = 0
for k in my_dict:
sum += my_dict[k]
print(sum)
print(my_dict)
45. Find the output
a = []
for i in range(0,100):
if (i % 3 == 0) or (i % 5 == 0) :
a.append(i)
print(a)
46. Which of the following is an invalid variable?
1. my_day_2
2. 2nd_day
3. Day_two
7|Page
4. _2
8|Page
9|Page