Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

this is a question in python. Please use basic tricks in list as much as possible, unless there is no other way to solve this.

this is a question in python. Please use basic tricks in list as much as possible, unless there is no other way to solve this. image text in transcribed
Write a program which creates a list of RANDOMLY chosen donations to 15 different charities. First, your program should first create a list of 100 donations, choosing both a random charity (1 15) and a random donation ($1.00 $100.00). You should print the the charity and donation, and also record both the charity and the donation in two lists, one integer and one float. When you are done creating the individual donations, go back through the data, and create a THIRD list, and total the donations for each charity. (This list is subscripted by the charity number (1-15) and contains floating point TOTALs. At the same time, create yet a FOURTH list that contains the count of the number of donations for each charity. This will be used below. Print out the total for each charity and the average donation for each of the charities. Finally, go back through the original data yet again, and for each donation, print out whether it was below, equal to, or above the average donation FOR THAT CHARITY, and how much it differed from the average

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Marketing Database Analytics

Authors: Andrew D. Banasiewicz

1st Edition

0415657881, 978-0415657884

More Books

Students also viewed these Databases questions

Question

=+When and under what circumstances are contracts renegotiated?

Answered: 1 week ago

Question

=+Are the contracts enforceable?

Answered: 1 week ago