Python Forum
Pass 2x Variables from Function to another Function
Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pass 2x Variables from Function to another Function
#3
You just pass them as two parameters:

def first(a):
    ab = a + 'b'
    ac = a + 'c'
    second(ab, ac)
def second(d, e):
    print('{} then {}'.format(d, e))
Edit: whoops, Buran beat me to it.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
RE: Pass 2x Variables from Function to another Function - by ichabod801 - Aug-14-2018, 01:55 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  The function of double underscore back and front in a class function name? Pedroski55 9 848 Feb-19-2024, 03:51 PM
Last Post: deanhystad
  How to pass encrypted pass to pyodbc script tester_V 0 943 Jul-27-2023, 12:40 AM
Last Post: tester_V
  How to print variables in function? samuelbachorik 3 980 Dec-31-2022, 11:12 PM
Last Post: stevendaprano
  User-defined function to reset variables? Mark17 3 1,745 May-25-2022, 07:22 PM
Last Post: Gribouillis
  Exit function from nested function based on user input Turtle 5 3,054 Oct-10-2021, 12:55 AM
Last Post: Turtle
  How to pass variables from one class to another hobbyist 18 11,221 Oct-01-2021, 05:54 PM
Last Post: deanhystad
  Regex - Pass Flags as a function argument? muzikman 6 3,753 Sep-06-2021, 03:43 PM
Last Post: muzikman
Question Stopping a parent function from a nested function? wallgraffiti 1 3,750 May-02-2021, 12:21 PM
Last Post: Gribouillis
Question exiting the outer function from the inner function banidjamali 3 3,677 Feb-27-2021, 09:47 AM
Last Post: banidjamali
  Possible to dynamically pass arguments to a function? grimm1111 2 2,288 Feb-21-2021, 05:57 AM
Last Post: deanhystad

Forum Jump:

User Panel Messages

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