Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Method returning None
#3
(May-04-2024, 11:36 AM)Gribouillis Wrote:
(May-04-2024, 11:12 AM)husksedgier Wrote: I would like to understand where I am going wrong.
All functions without a return statement return None in Python. If you want to return another value, include a return statement.

In your case however, apply_raise() is a "procedure", logically speaking: it does something (apply a raise) but it does not need to return any value. You could perhaps execute the action, then print the employee's pay instead of the result of the function.

Thanks a ton for shedding light... I'm still waddling through the Python jungle, barely out of the crib!
Reply


Messages In This Thread
Method returning None - by husksedgier - May-04-2024, 11:12 AM
RE: Method returning None - by Gribouillis - May-04-2024, 11:36 AM
RE: Method returning None - by husksedgier - May-04-2024, 06:38 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Class method returning multiple values,dont know which is returned when.. ujjwalrathod007 4 13,235 Oct-03-2016, 08:29 PM
Last Post: ujjwalrathod007

Forum Jump:

User Panel Messages

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