NEW
Font size
WorksheetsPython Coding Contest
Total questions: 20
Worksheet time: 15mins
Who developed Python Programming Language?
What will be the output of the following Python function?
len(["hello",2, 4, 6])
Error
What will be the output of the following Python code snippet if x=1?
x<<2
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 will be the output of the following Python program?
z=set('abc')
z.add('san')
z.update(set(['p', 'q']))
z
{‘a’, ‘c’, ‘c’, ‘p’, ‘q’, ‘s’, ‘a’, ‘n’}
{‘abc’, ‘p’, ‘q’, ‘san’}
{‘a’, ‘b’, ‘c’, ‘p’, ‘q’, ‘san’}
{‘a’, ‘b’, ‘c’, [‘p’, ‘q’], ‘san}
Which of the following Python statements will result in the output: 6?
A = [[1, 2, 3],
[4, 5, 6],
[7, 8, 9]]
What will be the output of the following Python program?
i = 0
while i < 5:
print(i)
i += 1
if i == 3:
break
else:
print(0)
None
0
1
2
0
Error
Which of the following is a Python tuple?
{1, 2, 3}
{}
[1, 2, 3]
(1, 2, 3)
What will be the output of the following Python code snippet?
z=set('abc$de')
'a' in z
True
False
What will be the output of the following Python expression?
round(4.576)
4.6
4.5
What is output of print(math.pow(3, 2))?
9.0
None
None of the mentioned
What will be the output of the following Python code?
x = [[0], [1]]
print((' '.join(list(map(str, x))),))
01
Which of the following will run without errors?
round(45.8)
round(6352.898,2,5)
round()
round(7463.123,2,1)
What is the return type of function id?
int
float
bool
dict
What error occurs when you execute the following Python code snippet?
apple = mango
ValueError
NameError
SyntaxError
TypeError
What is the average value of the following Python code snippet?
>>>grade1 = 80
>>>grade2 = 90
>>>average = (grade1 + grade2) / 2
Which is the correct operator for power(xy)?
x^y
x**y
x^^y
None of the mentioned
What is the answer to this expression, 22 % 3 is?
7
1
0
5
