I have a list in this format:
a = ["1.mp4", "10.mp4", "100.mp4", "2.mp4", "20.mp4", "200.mp4"]
I have to sort the above list in ascending order.
My code:
def ascend(a):
a.sort()
return a
a = ["1.mp4", "10.mp4", "100.mp4", "2.mp4", "20.mp4", "200.mp4"]
print(ascend(a))
My Output:
['1.mp4', '10.mp4', '100.mp4', '2.mp4', '20.mp4', '200.mp4']
And the actual Output should be
['1.mp4', '2.mp4', '10.mp4', '20.mp4', '100.mp4', '200.mp4']