Question

A bug collector collects bugs every day for one week (7 days). Write a program that...

A bug collector collects bugs every day for one week (7 days). Write a program that asks the user for the total number of bugs they collected for each day and stores each number in a list. Use a loop to calculate the total number of bugs and display the result.      (Python)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Program :

bugs=[]
for i in range(1,8):
print("Day ",i," bugs:",end="")
n=int(input())
bugs.append(n)
print("Total bugs:",sum(bugs))

Output:

main.py 1 bugs=[] 2- for i in range(1,8): 3 print(Day , i, bugs:,end) 4 n=int(input() 5 bugs.append(n) 6 print(Total bu

Add a comment
Know the answer?
Add Answer to:
A bug collector collects bugs every day for one week (7 days). Write a program that...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • A bug collector collects bugs every day for five days. Write a program that keeps a...

    A bug collector collects bugs every day for five days. Write a program that keeps a running total of the number of bugs collected during the five days. The while loop should ask for the number of bugs collected for each day, and when the while loop is finished, the program should display the total number of bugs collected.  using a while loop!!!!!!!!! not loop. Write the code in python !!!!!!!

  • 1. Day of the Week Write a program that asks the user for a number in...

    1. Day of the Week Write a program that asks the user for a number in the range of 1 through 7. The program should display the corresponding day of the week, where 1 = Monday, 2 = Tuesday, 3 = Wednesday, 4 = Thursday, 5 = Friday, 6 = Saturday, and 7 = Sunday. The program should display an error message if the user enters a number that is outside the range of 1 through 7. (On PYTHON IDLE...

  • Using the Phyton program; Write a program using loop (use days of the week as a...

    Using the Phyton program; Write a program using loop (use days of the week as a list) to ask the user to enter the total hours spend studying for each day of the week. How many hours spent studying on Monday? How many hours spent studying on Tuesday? Count and display the number of days the user 1) studied less than 4 hours. 2) studied between 4- 8 hours 3) studied more than 8 hours

  • Design a program that asks the user to enter a store's sales for each day of...

    Design a program that asks the user to enter a store's sales for each day of the week. The amounts should be stored in an array. Use a loop to calculate the total sales for the week and display the result. Be sure to attach your PYTHON code. No modularization required.

  • Total Sales Design a program that asks the user to enter a store’s sales for each...

    Total Sales Design a program that asks the user to enter a store’s sales for each day of the week. The amounts should be stored in an array. Use a loop to calculate the total sales for the week and display the result. Need: variable lists, IPO Chart, pseudocode, Flowchart, and working Python code. 2. Lottery Number Generator Design a program that generates a 7-digit lottery number. The program should have an Integer array with 7 elements. Write a loop...

  • In Python. Write a program that will calculate the amount of money a person would earn...

    In Python. Write a program that will calculate the amount of money a person would earn over a period of time if his/her salary is one penny the first day and two pennies for the second day, and continue to double each day. Hints: Declare variables Get the number of days from the user. Show the salary table for each day 4. Use ‘for loop’ to loop through the range of days (1, num_days +1) 5. Display the total pay...

  • Design a program using Flowgorithm or any flowcharting software that asks the user to enter a...

    Design a program using Flowgorithm or any flowcharting software that asks the user to enter a store's sales for each day of the week. The amounts should be stored in an array. Use a loop to calculate the total sales for the week and display the result. PSEUDOCODE AND FLOWCHART IS REQUIRED FOR THIS CLASSWORK.

  • Write a java program that uses a loop to input, from the user not using gui,...

    Write a java program that uses a loop to input, from the user not using gui, a collection of values that are the number of steps taken each day for a sequence of days and stores those amounts in an array. the array length should be 31, The user is not required to enter 31 values. the program determines and displays the largest number of steps for a single day, the smallest number of steps for a single day and...

  • PAYTHON PROGRAM WITHOUT ANY FUNCTION AND METHOD A program that will allow a grocery store to...

    PAYTHON PROGRAM WITHOUT ANY FUNCTION AND METHOD A program that will allow a grocery store to keep track of the total number of bottles collected for a seven-day period. The program should allow the user to enter the number of bottles returned for each day of the seven-day period. The program will accumulate the total number of bottles returned for the 7-day period. Then calculate the amount paid out (the total bottles returned times .10 cents). The output (display) of...

  • Write a program to find number of days in a month: Header comments must be present...

    Write a program to find number of days in a month: Header comments must be present Prototypes must be present Use comments and good style practices NOTE: For simplicity, we will ignore leap years (i.e. February will always have 28 days). main() function: Display hello message Call getMonth and assign result to month Call getDaysInMonth and assign result to days Display results Display goodbye message getMonth() function: Prompt user for month Loop until month is between 1 and 12 Return...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT