Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a function longest_heat_wave (temps) that accepts as input a list of numbers (temps) representing temperatures measures at consecutive days and that computes as output

image text in transcribed

Write a function longest_heat_wave (temps) that accepts as input a list of numbers (temps) representing temperatures measures at consecutive days and that computes as output the maximum number of consecutive days with temperature at least 30 degrees. For example: >>> longest_heat_wave ([10, 12, 20, 40, 39, 38, 30, 20, 35, 36]) 4 >>> longest_heat_wave ([20, 25, 31]) 1 >>> longest_heat_wave ([-1, 5, 10]) 0 Your program is not allowed to contain any imports

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions