write using a python idle M Inbox (2025) jeffrey dup. x Online Photo Editor IPod
ID: 3786946 • Letter: W
Question
write using a python idle
M Inbox (2025) jeffrey dup. x Online Photo Editor IPodr Edit.. x 13 Top 20 noasons why 2Pac- x Osaka ieUR csc110Spri X https sakai. uriedu/p 3 A bug collector collects bugs every day for seven days. Write a program in Python that keeps a running total of the number of bugs collected during the seven days. The program should ask for the number of bugs colected each day, and when the loop is finished, the program should display the total number of bugs collected in the week. Your output willook something like this: Python 3. (Apple d 5666) (dot RESTART: Asers/L How bugs did How shery bugs did day 3 How sery bugs did yo How sery bugs did yo day 4? 99 day 5? 36 How sery bugs did yo day 6 How sery bugs did yo How nery bugs did yo ected S82 bu Submission Your attached submission Attachments No solo a file fro mputer Browse No file selected. select files freem workspace 4 submit Preview save Draft Cancel Don't forgot to save or submit 02017 Urversny ot Rhode Island AInghts esenved of Rhode Island, Kingston, RI UR is an equal opportunity employ to the principles RUNK-Sakai 10- SNAPSHOT (Kemel 10 SNAPSHOT Server uni02 Sarver Time: Fri,03 ESTExplanation / Answer
Hi,
Here, I have used python27, you can use other versions of python there will be slight change in the syntax but logic is same. If there is any doubt or confusion feel free to ask.
i=1 #variable initialization
count=0 #variable for summation
while i<=7: #checking condition for 7 days
a=int(raw_input("How many bugs did you collect today:")) #user input in variable 'a'
count=count+a #summation of the values
i=i+1 #incrementing till 7 to exit while loop
print "Total bugs collected this week is:",count
Thankyou for using Chegg!!!
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.