How would I develop a Python program that takes integers, n and s (start) as input and computes the arithmetic average of numbers [Start+1, Start+2…..Start+N-1} and prints the results. This is my program right now, I’m stuck on the for loop part.
How would I develop a Python program that takes integers, n and s
(start) as input and computes the arithmetic average of numbers [Start+1, Start+2…..Start+N-1} and prints the results.
This is my program right now, I’m stuck on the for loop part.
N = int(input(“Pick an integer for N.”))
print(“N =”,N)
Start = int(input(“Pick a starting integer.”))
print(“Start =”,Start)
total = 0
for i in[Start, Start + N]:
total += i
print(str(total))
print(str(total/N))
This program doesn’t seem right but I can’t figure a solution.