Font size
WorksheetsClass XI Revision I
Total questions: 43
Worksheet time: 16mins
Which of the following is not a keyword?
eval
assert
nonlocal
pass
Which of the following cannot be a variable?
__init__
in
it
on
Which of the following are invalid variables?
my_string_1
1st_string
foo
__
my&string
Select correct Boolean literal
true
TRUE
false
True
Which of the following declarations is incorrect?
x=2
_x=3
_xyz_=5
None of these
Identify the invalid logical operator in Python from the following
and
or
not
Boolean
Which of the following is correctly evaluated for this function? pow(x,y,z)
(x**y)/z
(x/y)*z
(x**y)%z
(x/y)/z
Which of the following is an invalid statement?
abc = 1,000,000
a b c = 1000 2000 3000
a,b,c = 1000, 2000, 3000
a_b_c = 1,000,000
What data type is the object below? L = 1, 23, ‘hello’,1
list
dictionary
array
tuple
What is the value of this expression 2*3**2**1 ?
9
12
18
36
Operators with the same precedence are evaluated in which manner?
left to right
right to left
can't say
None of the mentioned
Select the option that makes x get an integer value.
x = 13 // 2
x = int(13 / 2)
x = 13 % 2
All of the mentioned
What will be the output ?
s='hello\nworld'
print(s[3:8])
lo
wo
lo\nwo
llo
wo
llo\nwo
What will be the output of the following code ?
print(“100+200”)
300
100200
100+200
200
Which of the following results in a SyntaxError?
' "Once upon a time…", she said.'
"He said, ' Yes!' "
'3\'
" 'That's okay " '
Which of the following will print the lines in this way
Term1
Preboard
CBSE
a) print('''Term1
Preboard
CBSE''')
print("Term1, Preboard, CBSE")
print('Term1\nPreBoard\nCBSE')
print('Term1\
Preboard\
CBSE')
A=tuple(“Python”)
print(A)
What is the output?
(‘Python’)
('Python',)
(‘P’,‘y’,‘t’,‘h’,‘o’,‘n’)
Error in first line.
Write the output of the following:
a=(“Amit”,“Sumit”,”Ashish”,”Sumanta”)
print(max(a))
Sumanta
Ashish
Sumit
Amit
List AL is defined as follows: a=[1,2,3,4,5]
Which of the following statement/statements removes the middle element 3 from it so that the list a equals [1,2,4,5] ?
del a[2]
a[2:3] = [ ]
a[2 : 2]=[ ]
a[ 2 ] = [ ]
a.remove(3)
Which command can we use to add 5 at the third position in list1?
list1.insert(3,5)
list1.insert(2,5)
list1.add(3,5)
list1.append(3,5)
Which of the following is not a complex number?
k = 2 + 3j
k = complex(2, 3)
k = 2 + 3i
k = 2 + 3J
What does ~~~4 evaluate to?
-5
-4
-3
+3
What is the value of x if:
x>>2=2
8
4
2
1
Which of the following are incorrect?
x = 0b101
x = 0x4f5
x = 09123
x = 0o864
What will be the value of the following Python expression?
4 + 3 % 5
4
7
2
0
What will be the value of X in the following Python expression?
X = 2+9*((3*12)-8)/10
30.0
30.8
28.4
27.2
What will be the output of the following Python expression if x=15 and y=12?
x&y
b1101
0b1101
12
1101
What will be the output of the following Python code snippet?
['hello', 'morning'][bool('')]
IndexError
No output
'hello'
'morning'
What will be the output of the following Python code snippet?
not(1&1)
True
False
0
1
What will be the output of the following Python code?
if (9 < 0) and (0 < -9):
.... print("hello")
elif (9 > 0) or False:
.... print("good")
else:
.... print("bad")
TypeError
'hello'
'good'
'bad'
If the following code is executed, what will be the output of the following code?
Title="Online Teaching 2021"
print(Title[6:10], Title[-2:-4:-1])
'Tea 20'
'e Tea 202'
'Tea 1202'
'Teac 1202'
Write the output of the following python expression: print((4>5) and (2==1) or (4<9) or (2/0))
False
True
ZeroDivisionError
Suppose list1 is [2, 33, 222, 14, 25],
What is list1[:-1] ?
[2, 33, 222, 14]
[ ]
[25]
[25, 14, 222, 33, 2]
Which of the following is not a declaration of the dictionary?
{1: ‘A’, 2: ‘B’}
dict([[1,”A”],[2,”B”]])
{1,”A”,2”B”}
{ }
Suppose d = {"john":40, "peter":45}, to delete the entry for “john” what command do we use?
d.delete("john":40)
d.delete("john")
del d["john"]
d.remove("john")
d.popitem('john')
b=(1,5,98,214,2,6)
Which of the following methods are wrong?
print(b.sort())
print(len(b))
print(b[2])
print(b.index(2))
Which of the following will raise an error if the given key is not found in the dictionary?
del statement
pop()
getitem()
All of these
Write the output of the following:
a=(1,2,3,2,3,4,5)
print(min(a)+max(a)+a.count(2))
13
6
8
AttributeError
What does strip() function on a string do?
Removes the trailing or leading spaces
Removes '\n' at the end of the string
Removes all the spaces between words
Removes the trailing or leading spaces and any spaces in between too
Which of the following statements will return the first three characters of a string s ?
s[3:]
s[:3]
s[0:4]
s[-4: :-1]
What is 4%3//5?
0
1
ZeroDivisionError
0.0
1.0
What is the return value of math.trunc() ?
int
bool
float
None
Which of the following expressions results in an error?
float('10')
int('10')
float('10.8')
int('10.8')
int(10.8)
