Sal's Shipping

TypeError: ‘<’ not supported between instances of ‘NoneType’ and ‘float’

I’m not understanding where did I make a mistake. Is there anyone who can help me out? Thanks in advance!

Your error tells you where to look. One of the functions that get called inside your last function is returning None, which can’t be compared with a number. Try to call each of those functions separately with the same argument you give when calling the last function.
Can you find which one is returning None?

3 Likes

Can you please elaborate why is this returning None?

A function will always return a None object if no valid return/yield statement is executed during when it is run. Try @fadelm0’s suggestion to try and hunt any errors down.

Breaking it down into smaller steps and using print to determine what is what at any one moment in time is often a good way to go if you can’t immediately spot an error.

3 Likes

Thanks. It’s running now!

1 Like