NEW
Font size
WorksheetsPy-ngo Workshop Quiz_GDSC
Total questions: 15
Worksheet time: 8mins
Find the output upon running this code
mango
cherry
litchi
banana
thislist = ["apple", "banana", "cherry", "orange", "kiwi”]
thislist[1:3] = ["blackcurrant", "watermelon"]
print(thislist)
Output for the following code is :
[‘blackcurrant’, ‘watermelon’, ‘cherry’, ‘orange’, ‘kiwi’]
["apple", "blackcurrant", "watermelon", "orange", "kiwi”]
["blackcurrant", "banana", "watermelon", "orange", "kiwi”]
["apple", "banana", "cherry", "orange", "kiwi”]
Statement1 : Lists are faster for accessing individual elements than arrays
Statement2: Array is faster when it comes to removing or adding elements than list
Both statements are true
1 is true, 2 is false
Both are false
2 is true, 1 is false
Which statement is used to break out of a loop?
return
break
end
pass
str= “ I am 18 years old .\n I can vote.”
What is “\n” (backslash n) command used for ?
Create space in between words
Shift the text to next line
Remove the text
Delete the space in between two words
Fill in the blanks with the name of the appropriate module to get the output "6"
maths
math
mathematics
numpy
Find the output of the code
[50, 100, 150, 200, 1, 50, 5]
[50, 100, 150, 200, 1, 50, 5, 1, 50, 5]
[50, 100, 150, 200]
AttributeError
Find the output of the code
10
30
50
70
Find the output of the code
7
8
9
10
Find the output of the code
[90, 65, 76, 50, 42, 40, 79]
[90, 65, 76, 50, 42, [40, 79]]
[90, 65, 76, 50, 42, [40], [79]]
AttributeError
Find the output of the code
I found my watch at the tuck shop
I found my w!tch !t the tuck shop
I found my w!tch at the tuck shop
I found my w!tch 1t the tuck shop
Evaluate the expression in Python
0
51
0.0
51.0
Find the output of the code
5
6
7
8
Find the output of the code
{'A': 10, 'B': 14, 'C': 19}
{'A': 10, 'B': 15, 'C': 19}
{'A': 10, 'B':21 , 'C': 19}
AttributeError
Fill in the blank to get the output "ppalepaln"
concatenate
mix
join
There is no function that can lead to the desired output
