NEW
Font size
WorksheetsPython Test-2A
Total questions: 11
Worksheet time: 4mins
Which of the following is true for variable names in Python?
underscore and ampersand are the only two special characters allowed
unlimited length
all private members must have leading and trailing underscores
none of the mentioned
What will be the value of the following Python expression?
4 + 3 % 5
7
2
4
1
What will be the output of the following Python code snippet if x=1?
x<<2
4
2
1
8
What are the values of the following Python expressions?
2**(3**2)
(2**3)**2
2**3**2
512, 64, 512
512, 512, 512
64, 512, 64
64, 64, 64
Which of the following is the truncation division operator in Python?
|
//
/
%
What will be the output of the following Python expression if x=56.236?
print("%.2f"%x)
56.236
56.23
56.0000
56.24
What will be the output of the following Python statement?
"a"+"bc"
bc
abc
a
bca
Which one of the following is not a keyword in Python language?
pass
eval
assert
nonlocal
What arithmetic operators cannot be used with strings in Python?
*
–
+
All of the mentioned
What is the maximum possible length of an identifier in Python?
79 characters
31 characters
63 characters
none of the mentioned
Which of the following is the use of id() function in python?
Every object doesn’t have a unique id
Id returns the identity of the object
All of the mentioned
None of the mentioned
