Python Forum
how to get the value out the def function
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to get the value out the def function
#2
Use return.
Example
def some_function(input_value):
    what_to_return = input_value + 100
    return what_to_return

returned_value = some_function(10)
print(f'Returned value: {returned_value}')
Output:
Returned value: 110
Reply


Messages In This Thread
RE: how to get the value out the def function - by Yoriz - Mar-09-2019, 05:41 PM

Forum Jump:

User Panel Messages

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