Python Forum
How to access arguments by name from function
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to access arguments by name from function
#2
Names defined in the function are only available in the function. If you need them outside the function, return a dictionary:

def foo(list1, list2, list3):
    return {'list1': list1, 'list2': list2, 'list3': list3}
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
RE: How to access arguments by name from function - by ichabod801 - Sep-19-2019, 01:43 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  calling external function with arguments Wimpy_Wellington 7 1,522 Jul-05-2023, 06:33 PM
Last Post: deanhystad
  'namespace' shorthand for function arguments? shadowphile 5 2,654 Aug-11-2021, 09:02 PM
Last Post: shadowphile
  Checking the number of arguments a function takes Chirumer 3 2,210 Jul-06-2021, 04:56 PM
Last Post: Chirumer
  Possible to dynamically pass arguments to a function? grimm1111 2 2,229 Feb-21-2021, 05:57 AM
Last Post: deanhystad
  How to pass multiple arguments into function Mekala 4 2,486 Jul-11-2020, 07:03 AM
Last Post: Mekala
  How to give a name to function arguments in C-API? WonszZeczny 0 1,371 Jun-22-2020, 10:20 AM
Last Post: WonszZeczny
  Function Recognises Variable Without Arguments Or Global Variable Calling. OJGeorge4 1 2,282 Apr-06-2020, 09:14 AM
Last Post: bowlofred
  Pass Arguments to Function phillyfa 2 2,058 Mar-27-2020, 12:05 PM
Last Post: phillyfa
  Function with many arguments, with some default values medatib531 3 2,630 Mar-14-2020, 02:39 AM
Last Post: medatib531
  Using function *args to multiply multiple arguments allusernametaken 8 6,176 Nov-20-2019, 12:01 AM
Last Post: allusernametaken

Forum Jump:

User Panel Messages

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