i was trying to take the input and then applying sort function but the output s showing none please tell me where did i go wrong?
numbers = [int(numbers) for numbers in input().split()]
print(numbers)
l = numbers.sort()
print(l)
i was trying to take the input and then applying sort function but the output s showing none please tell me where did i go wrong?
numbers = [int(numbers) for numbers in input().split()]
print(numbers)
l = numbers.sort()
print(l)
Because sort does the sorting inplace thats why the values are sorted in the numbers list itself and there is nothing foe the function to return thats why ur output is None.
Try:
numbers = [int(numbers) for numbers in input().split()]
print(numbers)
numbers.sort()
print(numbers)