Update the given Python code such that the output will be printed in ascending order.
lst = [3, 1, 4, 5, 2]

for number in lst:
    print(number)
lst = [3, 1, 4, 5, 2]

for number in sorted(lst):
    print(number)