Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4. Suppose we discovered that the measurement of CO2 values was uniformly too low by a small fraction p. Write a function that increases each

image text in transcribed
4. Suppose we discovered that the measurement of CO2 values was uniformly too low by a small fraction p. Write a function that increases each value in co2_levels by the fraction p. (In other words, if x is the value before the increase then x (1 + p) is the value after.) For this problem you need to use range() Len(), and indexing. Start by asking the user for the percentage. Output the first and last values of the revised list. Your program should end with the ines: print('First: ti.2f).format (co2_levels te])) print( "Last: {:.2format ( co2-levels [-1])) Here is an example of running your program: Enter the fraction: 0.03 First: 329.63 Last: 404.74 5. Write a function called is increasing() that returns True if the values in the list it is passed are in increasing order and False otherwise. Use a for loop and indexing to accomplish this. Test the function with the following main code: print( "co2-levels is increasing: forma t (is-increasing (co2-1evels))) test L1 [15, 12, 19, 27, 45] print ('test_L1 is increasing: .format(is increasing(test_L1))) test-L2= l'arc', 'circle', 'diameter', 'radius','volume', 'area'] print('test_L2 is increasing: (".format (is_increasing(test L2))) test_L3 [11, 21, 19, 27, 28, 23, 31, 45] print ('test_L3 is increasing:'.format(is_increasing(test_L3)) These should be the only print) function calls in the code you submit

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

Relational Database Design With Microcomputer Applications

Authors: Glenn A. Jackson

1st Edition

0137718411, 978-0137718412

More Books

Students also viewed these Databases questions

Question

Are there any questions that you want to ask?

Answered: 1 week ago