A tuple named subject stores the names of different subjects. Write the Python commands to convert the given tuple to a list and thereafter delete the last element of the list. [2 MARKS] [2024]
subject=list(subject)
subject.pop()
OR
subject=list(subject)
subject.pop(-1)
OR
subject=list(subject)
del subject[-1]
Given is a Python list declaration : [1 MARK] [2023]
Listofnames= ["Aman", "Ankit", "Ashish", "Rajan", "Rajat"]
Write the output of :
print(Listofnames[-1 : -4 : -1])
['Rajat', 'Rajan', 'Ashish']
Which function returns the sum of all elements of a list ? [1 MARK] [2023]
a) count()
b) sum()
c) total()
d) add()
b) sum()
__________ function is used to arrange the elements of a list in ascending order. [1 MARK] [2023]