Here is my program and i am getting "(AttributeError: module 'math' has no attribute 'round')" error message
import math
def profit(info):
cost = info['cost_price']
sell =info['sell_price']
num = info['inventory']
return math.round((sell-cost)*num)
Unlike ceil, floor, and trunc, round can be found in the standard library as a built-in function.
So you don't need import "math"
def profit(info):
cost = info['cost_price']
sell =info['sell_price']
num = info['inventory']
return round((sell-cost)*num)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With