मराठी

What will be the output of the following statement? list1 = [12,32,65,26,80,10] sorted(list1) print(list1) - Computer Science (Python)

Advertisements
Advertisements

प्रश्न

What will be the output of the following statement?

list1 = [12,32,65,26,80,10]
sorted(list1)
print(list1)
टीपा लिहा

उत्तर

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
List
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 9: Lists - Exercise [पृष्ठ २०४]

APPEARS IN

एनसीईआरटी Computer Science [English] Class 11
पाठ 9 Lists
Exercise | Q 1. ii. | पृष्ठ २०४
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×