Advertisements
Advertisements
प्रश्न
What will be the output of the following statement?
list1 = [12,32,65,26,80,10]
list1.sort()
print(list1)टीपा लिहा
Advertisements
उत्तर
The sort() method will sort the list in ascending order in place.
OUTPUT:
[10, 12, 26, 32, 65, 80]
shaalaa.com
Lists in Python
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
APPEARS IN
संबंधित प्रश्न
What will be the output of the following statement?
list1 = [12,32,65,26,80,10]
sorted(list1)
print(list1)What will be the output of the following statement?
list1 = [1,2,3,4,5,6,7,8,9,10]
list1[::-2]
list1[:3] + list1[3:]What will be the output of the following statement?
list1 = [1,2,3,4,5]
list1[len(list1)-1]Write a program to find the number of times an element occurs in the list.
