Ask the user for a random number and assign the value to a variable named starting. Then using a for loop and write a program that asks the user for input of 5 numbers. Each of these numbers must be added to the initial value of the variable starting. The output must be the initial and final value of the variable starting. Please name the program and provide at least one code comment.
n = int(input())
c = n
for i in range(0,5):
x = int(input())
c = c + x
print('initial',n)
print('final',c)
Comments
Leave a comment