compute average numbers from 1 to n where n is a positiove integer value and assign it to the variable avg in python
n = int(input()) sum = 0 for i in range(1, n + 1): sum += i avg = sum / n print('avg =', avg)
Need a fast expert's response?
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Comments
Leave a comment