Python 3 for beginners ep14 - Passing variables between functions

preview_player
Показать описание
Hey guy's R4GE VipeRzZ here and today in this video I will show you how to pass variables between functions.

For all of my Python 3 videos I will be using the IDLE editor when it is possible.

If you can't understand my accent Closed Captions are available. To turn on the closed Closed Captions click on the settings icon, then click subtitles/CC, and then click English (United Kingdom).
Рекомендации по теме
Комментарии
Автор

SUPER, SUPER helpful. My instructor + Google + Stackoverflow weren't helping at all. This was so simple and helpful.

The only additional thing I would ask would be, what about a function pulling variable from multiple functions?

so maybe something like:

a function "drinks" with variables of tea, soda, juice (perhaps assigned black, coke, apple respectively)
a separate function "entree" with variables of beef, pork, chicken (perhaps ribeye, bbq, fried chicken respectively)
a separate function "desserts" with variables of pudding, cake, ice cream (perhaps tapioca, red velvet, rocky road)
sending their variables off to function "full_meal"

JaceLovesStrength
Автор

I have been struggling for days to figure out how to get variables from one function to another. So many of the videos and blogs post hypocritical responses to questions, or they provide a full page of code that require a python expert to understand fundaments. INSANE. Your video on passing variable is absolutely perfectly clear and simple. Thank you so much.

gmwillis
Автор

Completely new to python and programming, taking a class. I've been stuck on this for an assignment for hours and neither my class videos, the book, nor the professor explained it clearly. This video helped me figure out where I was stuck in less than 3 minutes. Thanks friend, you're awesome <3

TheOnceandFutureGeek
Автор

tRNA. You for the concise explanation. It helped wrap my brain around this nuance of python!

timsim
Автор

I'm in the same place as Jace, I am watching a video of my uni lecturer making me more confused, google was no help, this video makes it ridiculously clear. Thank you so much for this no nonsense, very logical explanation. AAaaand subscribed

NoMusiciansInMusicAnymore
Автор

Thank you so much! Have been struggling to find a solution to this for hours and this explains it perfectly.

noorulhaq
Автор

So how do you pass parameters into a function in another module?

grampagraham
Автор

OMG been struggling for this thanks !!

austin
Автор

Bless you! This is exactly what I needed!

andrewolacey
Автор

Thanks you. This is such a helpful video for beginners

scotth
Автор

Thanks man, this video helped me a lot with my assignment, lots of respect

umidakbarov
Автор

Thank you so much for this video. I couldn't figure out how to pass variables w/out using global. This video made it clear and simple.

brandyheckenkamp
Автор

How can I print a function parameter alone without calling the function. Like in this case, how can you print number1 from test(number1, number2) outside the function?

andrewkimani
Автор

I actually had all my code working and this was missing! You helped me a lot, thanks!

tengohamudi
Автор

Thanks for this, I’m going to try it out!

axc
Автор

You made it so simple to understand. Thanks a lot :)

niveditaraj
Автор

what if i only want to assign one value to the in another function that take to inputs in ?
ex:
def hello(data)
data=equals something
def bye(data, stats)

iboa
Автор

Can I define number1 and number2 as global instead?

gorillacapers
Автор

How do you pass a variable from a function that was called by the main function back to the main function?

Y = 2

Def main ():
One()
Two()

Def one():
X = input (‘enter a number’)

Def two():
Total = x * y

How do I get the input (x) from function one to go back to the main function so that it be passed to function two so that it can do the calculation?

sra
Автор

You have this big white screen but all the action is 20px high. Thanks.

pikadroo