Odpowiedź :
number = 0
while number <= 50:
prev = number
number = int(input("Enter number: "))
print("Sum = ", prev + number)
print("Last entered number: ", number)
number = 0
while number <= 50:
prev = number
number = int(input("Enter number: "))
print("Sum = ", prev + number)
print("Last entered number: ", number)