Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How do I print the number of times the max temp occurs in Python? (I can't use any built-in functions to find the maximum temp.)

How do I print the number of times the max temp occurs in Python? (I can't use any built-in functions to find the maximum temp.)

image text in transcribed

1 2 3 temps = [1,9,4,9,9] max_temps = temps[@] hot_days = [] undefined [9] OOO OU W for temperature in temps: if temperature > max_temps: max_temps = temps [-1] hot_days = hot_days + [temperature] 11 print(max_temps) print(hot_days) print len(hot_days) 12

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_2

Step: 3

blur-text-image_3

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

More Books

Students also viewed these Databases questions

Question

1.The difference between climate and weather?

Answered: 1 week ago

Question

1. What is Fog ?

Answered: 1 week ago

Question

How water vapour forms ?

Answered: 1 week ago

Question

What is Entrepreneur?

Answered: 1 week ago

Question

Which period is known as the chalolithic age ?

Answered: 1 week ago