Computer Science, asked by Jmlane, 7 months ago

Write a python program that uses while loops to display the number of bugs collected throughout 5 days. In addition to displaying the total number of bugs collected, display the average number of bugs collected per day. The average should be displayed with 1 digit to the right of the decimal.

Answers

Answered by Anilkumar54406
1

Answer:

here is your answer

Explanation:

You missed adding the bugs collected today to the entire collection of bugs

You can add an outside var bugs = 0

And edit the first line after while to:

bugs = int(input('enter the amount of bugs collected today:')) + bugs

You entire code will look like this:

i = 1

bugs = 0

while i < 8:

bugs = int(input('enter the amount of bugs collected today:')) + bugs

average = bugs / 7

i+=1

print('average amount of bugs collected in a week is:', average)

Similar questions