-
Output of: max(''please help ‘’)
a. please, help
b. Error
c.p -
What command is used to shuffle a list ‘L’?
a. L.shuffle(), b. random.shufflelist(L) c. shuffle(L) d.random.shuffle(L)
3.What is the output of the following program?
language = [‘P’, ‘y’, ‘t’, ‘h’, ‘o’, ‘n’]
print(language[:-4])
a. [‘t’] b. [‘P’,‘y’] c. [‘P’,‘y’,‘t’] c.[‘t’,‘h’,‘o’,‘n’]
4.Suppose a tuple test contains 5 elements. How can you set the 3rd element of the tuple to ‘Python’?
a. test[2] = ‘Python’
b. test[3] = ‘Python’
c. test(2) = ‘Python’
d. Elements of tuple cannot be changed
- How can you change num = {‘one’: 1, ‘two’: 3} to num = {‘one’: 1, ‘two’: 2}
a. num[2] = ‘two’
b. num[1] = ‘two’
c. num[‘two’] = 2
d. num[‘two’] = ‘2’