Advertisements
Advertisements
प्रश्न
What will be the output of the following statement?
list1 = [12,32,65,26,80,10]
sorted(list1)
print(list1)टिप्पणी लिखिए
Advertisements
उत्तर
The sorted() function takes a list as a parameter and creates a new list consisting of the same elements arranged in sorted order. It doesn’t change the list which is passed as a parameter itself.
OUTPUT:
[12, 32, 65, 26, 80, 10]
shaalaa.com
Lists in Python
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
