WorksheetsPython Quiz - 20
Total questions: 8
Worksheet time: 4mins
Guess the correct output of the following string operations
str1 = 'Welcome'
print(str1*2)
WelcomeWelcome
str1str1
Error
None of the above
Write the following output of the following code :
list('Welcome')
['W','e','l','c','o','m','e']
('W','e','l','c','o','m','e')
['welcome']
None of the above
Write the following output of the following code :
>>>L = ['w','e','l','c','o','m','e']
>>>print(len(L))
8
9
7
None
Write the following output of the following code :
>>> L=[“Amit”,”Anita”,”Zee”,”Longest Word”]
>>> print(max(L))
Longest Word
Zee
Error
None
Write the output of the following code :
L=list(“www.learninghpython.com”)
print(L[20 : -1])
['c','o']
['c','o','m']
(com)
Error
None of the above
Write the output of the following code :
>>>L=[“Amit”,”Sumit”,”Naina”]
>>>print(L[-1][-1])
['Sumit']
[a]
[Naina]
None of the above
Write the output of the following code :
L=[0.5 * x for x in range(4)]
print(L)
[0.0, 0.5, 1.0, 1.5]
(0,.5, 1, 1.5)
[0.0, 0.5, 1.0, 1.5, 2.0]
None
Write the output of the following code :
L=[‘a’ * x for x in range(4)]
print(L)
[‘ ‘ , ‘a’ , ‘aa’ , ‘aaa’]
[‘a’, ‘aa’, ‘aaa’]
Error
None of the above
