Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
python modules?
#6
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.
Reply


Messages In This Thread
python modules? - by Kuron3ko - Feb-07-2018, 09:19 PM
RE: python modules? - by nilamo - Feb-07-2018, 09:47 PM
RE: python modules? - by Gribouillis - Feb-07-2018, 09:53 PM
RE: python modules? - by Kuron3ko - Feb-07-2018, 10:15 PM
RE: python modules? - by buran - Feb-08-2018, 07:14 AM
RE: python modules? - by kmcollins - Feb-10-2018, 04:47 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020