briank282
New Coder
so when i try running this code it says tli3 is not refernced although i made it equal to value??
import math
# trophic_level_index definition goes here
def trophic_level_index(chla, tn, tp):
""" Takes values for CHLA, TN and TP and returns
the average of the log transformed values.
"""
# complete this function.
tlc = 2.22 + 2.54 * math.log(chla,10)
tln = -3.61 + 3.01 * math.log(tn,10)
tlp = 0.218 +2.92 * math.log(tp,10)
tli3 = (tlc + tln +tlp) / 3
return(tli3)
# math.log(x, 10) will return log base 10 of x
# years_to_achieve_goal_tli3 definition goes here
def years_to_achieve_goal_tli3(c_0, tn_0, tp_0, goal_tli3, yearly_reduction):
"""fff"""
tli3 = value
year = 0
total = yearly_reduction
while value < goal_tli3:
increase = value * total
value = value - increase
year += 1
return(year)
import math
# trophic_level_index definition goes here
def trophic_level_index(chla, tn, tp):
""" Takes values for CHLA, TN and TP and returns
the average of the log transformed values.
"""
# complete this function.
tlc = 2.22 + 2.54 * math.log(chla,10)
tln = -3.61 + 3.01 * math.log(tn,10)
tlp = 0.218 +2.92 * math.log(tp,10)
tli3 = (tlc + tln +tlp) / 3
return(tli3)
# math.log(x, 10) will return log base 10 of x
# years_to_achieve_goal_tli3 definition goes here
def years_to_achieve_goal_tli3(c_0, tn_0, tp_0, goal_tli3, yearly_reduction):
"""fff"""
tli3 = value
year = 0
total = yearly_reduction
while value < goal_tli3:
increase = value * total
value = value - increase
year += 1
return(year)