Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You have a theory that certain days of the week are most likely to be the hottest. You are to write a program that will

You have a theory that certain days of the week are most likely to be the hottest. You are to write a program that will test that theory in Python.

Write a program that will have a list of 52 lists, each of those 52 lists must be of length 7 (that is they will each accommodate 7 items). Think of 52 weeks with 7 days in each week. Save a random value from 70 - 100 (inclusive of 70, exclusive of 100) in each of the days of each of the weeks.

Your code should analyze the list above and print a list of the number of times each day of the week was the highest. If more than one day is the hottest of the week I do not care which of those days is recorded as the hottest.

Here is an example of the expected output: note that in the example below I generated and analyzed 5 weeks, you are to generate and analyze 52 weeks:

My code generated and output the following list of lists:

[[93, 98, 95, 75, 81, 88, 97], [91, 76, 81, 84, 72, 97, 83], [91, 81, 75, 72, 92, 95, 79], [98, 93, 88, 74, 93, 97, 82], [77, 86, 90, 87, 75, 84, 95]]

And output the following list after analysis of the above list:

[1, 1, 0, 0, 0, 2, 1]

The actual output from running my code was:

RESTART: /Users/janetbrownsederberg/CTIM285_Spring_2018/HottestDay.py

[[93, 98, 95, 75, 81, 88, 97], [91, 76, 81, 84, 72, 97, 83], [91, 81, 75, 72, 92, 95, 79], [98, 93, 88, 74, 93, 97, 82], [77, 86, 90, 87, 75, 84, 95]]

[1, 1, 0, 0, 0, 2, 1]

>>>

Please have your output in the form above.

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

Database Design For Mere Mortals

Authors: Michael J Hernandez

4th Edition

978-0136788041

More Books

Students also viewed these Databases questions

Question

2. What is the meaning and definition of Banking?

Answered: 1 week ago

Question

3.What are the Importance / Role of Bank in Business?

Answered: 1 week ago

Question

Conduct a needs assessment. page 283

Answered: 1 week ago