Define the function  number_in_trophic_class(tli3_values, classification) which takes a list of trophic level index values and a trophic classification, returning the number of lakes in that trophic class. For this version of the question you cannot use a list comprehension (or any comprehension) - you will get to use one in the next version of the question. :) Notes: You must include, and use/call your trophic_class function in your submission. Your tropic_class function must work in the same way it did for Question 2. You can assume that classification will always be valid, i.e. it will always be one of the states in the following list: ['Hypertrophic',  'Supertrophic',  'Eutrophic',  'Mesotrophic',  'Oligotrophic',  'Microtrophic',  'Ultra-microtrophic'] For example: Test Result tli3_list_1 = [4.1061, 2.54561, 4.16276, 2.33801, 6.71792, 5.54457, 6.49795, 2.1, 1.2, 1.4, 0.9, 3.8, 3.0] number = number_in_trophic_class(tli3_list_1, 'Microtrophic') print(f'{number} were Microtrophic.') 2 were Microtrophic. tli3_list_1 = [4.1061, 2.54561, 4.16276, 2.33801, 6.71792, 5.54457, 6.49795, 2.1, 1.2, 1.4, 0.9, 3.8, 3.0] number = number_in_trophic_class(tli3_list_1, 'Mesotrophic') print(f"{number} were Mesotrophic.") 2 were Mesotrophic.   def trophic_class(trophic_level_index):     '''Return the tropic classification indicated by the Trophic Level Index     value provided'''     if trophic_level_index >=6:         return ('Hypertrophic')     elif trophic_level_index >=5 and trophic_level_index < 6:         return ('Supertrophic')     elif trophic_level_index >=4 and trophic_level_index < 5:         return ('Eutrophic')     elif trophic_level_index >=3 and trophic_level_index < 4:         return ('Mesotrophic')     elif trophic_level_index >=2 and trophic_level_index < 3:         return ('Oligotrophic')     elif trophic_level_index >=1 and trophic_level_index < 2:         return ('Microtrophic')     elif trophic_level_index <1:         return ('Ultra-microtrophic')

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Define the function  number_in_trophic_class(tli3_values, classification) which takes a list of trophic level index values and a trophic classification, returning the number of lakes in that trophic class. For this version of the question you cannot use a list comprehension (or any comprehension) - you will get to use one in the next version of the question. :)

Notes:

  • You must include, and use/call your trophic_class function in your submission.
    • Your tropic_class function must work in the same way it did for Question 2.
  • You can assume that classification will always be valid, i.e. it will always be one of the states in the following list:
    • ['Hypertrophic',
       'Supertrophic',
       'Eutrophic',
       'Mesotrophic',
       'Oligotrophic',
       'Microtrophic',
       'Ultra-microtrophic']

For example:

Test Result
tli3_list_1 = [4.1061, 2.54561, 4.16276, 2.33801, 6.71792, 5.54457, 6.49795, 2.1, 1.2, 1.4, 0.9, 3.8, 3.0] number = number_in_trophic_class(tli3_list_1, 'Microtrophic') print(f'{number} were Microtrophic.') 2 were Microtrophic.
tli3_list_1 = [4.1061, 2.54561, 4.16276, 2.33801, 6.71792, 5.54457, 6.49795, 2.1, 1.2, 1.4, 0.9, 3.8, 3.0] number = number_in_trophic_class(tli3_list_1, 'Mesotrophic') print(f"{number} were Mesotrophic.")

2 were Mesotrophic.

 

def trophic_class(trophic_level_index):
    '''Return the tropic classification indicated by the Trophic Level Index
    value provided'''
    if trophic_level_index >=6:
        return ('Hypertrophic')
    elif trophic_level_index >=5 and trophic_level_index < 6:
        return ('Supertrophic')
    elif trophic_level_index >=4 and trophic_level_index < 5:
        return ('Eutrophic')
    elif trophic_level_index >=3 and trophic_level_index < 4:
        return ('Mesotrophic')
    elif trophic_level_index >=2 and trophic_level_index < 3:
        return ('Oligotrophic')
    elif trophic_level_index >=1 and trophic_level_index < 2:
        return ('Microtrophic')
    elif trophic_level_index <1:
        return ('Ultra-microtrophic')

 

Expert Solution
steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Knowledge Booster
Lists
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education