= [int(i) for i in input().split()] total = a[0] for i in range(1, len(a)): if a[i] > a[i-1]: b = a[i] - a[i-1] total += b print(total)
print
Quote:How do I make it so that the program outputs only the last number?
for i in range(1, len(a)): if a[i] > a[i-1]: b = a[i] - a[i-1] total += b print(total)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)