Open agrawal-shivani opened 4 years ago
The Difference between sorted() and sort() in Python.
Sorting Numbers: >> numbers = [4, 9, 2, 1] >> sorted(numbers) [1, 2, 4, 9] >> numbers [4, 9, 2, 1]
>> numbers = [4, 9, 2, 1]
>> sorted(numbers)
[1, 2, 4, 9]
>> numbers
[4, 9, 2, 1]
The Difference between sorted() and sort() in Python.
Sorting Numbers:
>> numbers = [4, 9, 2, 1]
>> sorted(numbers)
[1, 2, 4, 9]
>> numbers
[4, 9, 2, 1]