Feb-10-2018, 04:47 PM
Python cares deeply about the amount you indent. To indicate a block of code in Python, you must indent each line of the block by the same amount. A typical amount of indentation for Python is four spaces. This isn't the problem with your code, though, since all of your blocks each have the same amount of indentation for each line.
This is not the primary problem with your code, though. Although you return tip, you didn't assign it to anything outside of the method. It is out of scope when you try to use the result.
This is not the primary problem with your code, though. Although you return tip, you didn't assign it to anything outside of the method. It is out of scope when you try to use the result.