NEW
Font size
WorksheetsPYTHON APTITUDE
Total questions: 12
Worksheet time: 6mins
Find the output of the following program:
a = {i: i * i for i in range(6)} print (a)
What is the output of the following program :
print 0.1 + 0.2 == 0.3
0.3
False
Error
What is the output of this program?
Runtime Error
16
Indentation Error
What is the output of the expression : 3*1**3
1
What is the output of the following program :
0
1
2
3
0
0
1
2
0
0
1
2
Error
Which line of code produces an error?
(a) “one” + “2”
(b) ‘5’ + 6
(c) 3 + 4
(d) “7” + ‘eight’
(a)
(b)
(c)
(d)
Identify the invalid variable name in python?
(a) this_is_a_variable = 7
(b) abc = 10.22
(c) ThisBook = “python”
(d) %name = “xyz”
(a)
(b)
(c)
(d)
Find the output of this code:
loop
No Output
Infinite Looping
Error
How many numbers will be printed?
5
6
4
0
Identify whether the given loop is definite or indefinite.
Definite
Indefinite
How many numbers will be printed by this code?
0
1
9
10
If list = [1,2,3,4,5] then list[5] will result in _______
4
"list Index out of range" Error
1
5
