Could someone explain following results? In first case output is: '5 4 3 2 1' In second: '1 2 3 4 5' I don't understand it because I thought it use stack with LIFO (last in — first out). And result should be '1 2 3 4 5' regardless of position "print" function. I used PyCharm 2021.3.2 (Community Edition).
def pr(n):
if n >= 1:
print(n) # 1'st case
pr(n - 1)
# print(n) # 2'nd case
a = int(input())
pr(a)