173k views
0 votes
A bug collector collects bugs every day for seven days. Write a program in Python that finds the highest number of bugs collected over a course of seven days. The program should ask for the number of bugs collected each day, and when the loop is finished, the program should display the highest number of bugs collected in the week. Your output will look something like this:

1 Answer

6 votes

Answer:

mylist = [ ]

for i in range(7):

mylist.append (int(input("Enter the number of bugs for each day ")))

print(mylist)

print("The highest number of bugs is ")

print(max((mylist)))

Step-by-step explanation:

  1. Create and Initialize an empty (mylist)
  2. Using the .append method, we request and add the bugs for each day into the list
  3. print out the list
  4. Use the max function to find the highest number of bugs in the list and print it out
A bug collector collects bugs every day for seven days. Write a program in Python-example-1
User Cricket
by
3.9k points