NEW
Font size
WorksheetsData Analysis using Python
Total questions: 20
Worksheet time: 18mins
What is the result of 32 >> 2 ?
32
8
16
None
What's wrong with the following program?
Second print should not be indented
First print should be indented
if age > 18 is invalid
age = 24 is invalid
What is the value of X after solving the expression:
X = 10 / 2 * ( 3 >> 1 ) - 45 % 5 ?
5
10
5.0
7.5
What is the throughput of the following line of code:
int ( '10.5' )
10
10.5
ValueError
10.0
What is the output of the following program:
>>> list = [ 1, 2, 'Benjamin', 'studious' ]
>>> 'Benjamin is ' + list.pop( )
Benjamin is studious
Benjamin is
Benjamin is 1 2 Benjamin
Error
Consider a dictionary named food. What food.items( ) return ?
View object containing items
Object containing items
A dictionary
None
Spot the error in the following line:
dict = { 1: 'students', '2': 'faculties' }
Key 1 should be quoted with single quotes
Key 2 should not be quoted with single quotes
Values should not be quoted with single quotes
No Error
for k in range (5, -4, -2):
print(k, end=' ')
5 4 3 2 1 0 -1 -2 -3
5 4 3 2 1 -1 -3 -4
5 3 1
5 3 1 -1 -3
Determine the output of the following code:
hi !
hh ii !!
hhii! !
None
Determine the output of the following code:
11 13 14 16 17 19
11 12 13 14 15 16 17 18 19
11 13 14
None
What is the name of the test designed to determine a machine's ability to exhibit intelligent behaviour?
Rorschach Test
Miller Test
Wechsler Test
None
How to access the value 16 in the given list?
list3 [0][0][1]
list3[0][0][0][0]
list3[0][0][0][1]
list3[0][0][0]
What will be the output of the following code:
>>> a = [1, 2, 3]
>>> a.append([4, 5])
>>> print(a)
[1, 2, 3, 4, 5]
[1, 2, 3, [4, 5]]
Error
[1, 2, 3, 4]
hat is the output of the following:
>>> aTuple = "Yellow", 20, "Red"
>>> a, b, c = aTuple
>>> print(a)
(‘Yellow’, 20, ‘Red’)
TyepeError
Yellow
None
Determine the output of the following code:
>>> fruits = ('mango', 'orange', 'apple')
>>> *fruit1, fruit2, fruit3 = fruits
>>> fruit1
'mango'
['mango']
[ 'mango', 'orange', 'apple' ]
None
What is the output of the following code:
>>> list = [ 1, 2, 3, 4, 5 ]
>>> list[0: ] = [10]
>>> list
[10]
[10, 2, 3, 4, 5]
Error
None
What listQ is pointing to?
>>> list = [1, 2, 3, 4, 5]
>>> listQ = [ v**2 for v in list ]
>>> listQ
[1, 2, 3, 4, 5]
[2, 4, 6, 8, 10]
[1**2, 2**2, 3**2, 4**2, 5**2]
[1, 4, 9, 16, 25]
What listQ is pointing to?
>>> list = [1, 2, 3, 4, 5]
>>> listQ = [ v**2 for v in list ]
>>> listQ
[1, 2, 3, 4, 5]
[2, 4, 6, 8, 10]
[1**2, 2**2, 3**2, 4**2, 5**2]
[1, 4, 9, 16, 25]
Consider the following tuple:
>>> fruits = ('mango', 'orange', 'kiwi')
Which command can be used to change 'orange' to 'kiwi' ?
fruits.update('orange', 'kiwi')
fruits['orange'] = 'kiwi'
fruits.change('orange', 'kiwi')
None
The command used to give heading of the paragraph is _______
plt.show( )
plt.label( )
plt.xlabel( )
plt.title( )
