print() vs. return in Python Functions
HTML-код
- Опубликовано: 5 июн 2024
- In this video, you will learn the differences between the return statement and the print function when they are used inside Python functions. We will see an example of each one of them and its applications.
⏳ Content
00:00 Introduction
00:20 The return statement
01:58 print() in Python functions
04:27 Summary of their differences
💻 To learn more about Python, check out my playlist Python Basics for Beginners: • Python Basics for Begi...
📱 You can also find me on:
Twitter: / estefaniacassn
Instagram: / estefaniacassn
#coding #programming #python #pythonprogramming #learntocode #100daysofcode
I wonder why Estefania doesn't have millions of followers. She's by far better than those with millions subs. Every day I look at udemy to see if she has released a new course
If i'm not wrong! It is becoz India like countries have population more than 40-50 European countries
@@simply7712 indian beginners follow famous tutorial, beginners not search documentation types video (which is great for developer)
Beginners like me not know what programming language do and they can not write one line of code
This answered what I was exactly looking for!! Thank you! ------>
1)A function with a "return" will print whatever you want it to return after you pass it to a variable, while a function with a "print" outputs None!
2) if you call a function with a return, then it will output nothing unless you store it in a variable and call that variable
Yep and the variable called "result" cannot hold a print statement (result = print(x + y) It can hold (result = 8)
Thank you so much for sharing your knowledge with the rest of us. I highly appreciate it.
You just got yourself a new subscriber!
Been looking for the simplified explanation for the past few hours, this is what I needed all this while. Thank you.
By the way, this is my first time watching your videos, subscribed immediately, I hope to come back here and learn more. Thank you once again. You are doing a great job 💪🏾
Perfectly explained, Thank you.
Más claro imposible, muchas gracias Estefanía!
Thank you so much. You explained it very well. I totally understand it now, thank you again.
Simple and easy to understand!
Great video! Idea was communicated clearly!
very well explained Estefania...cheers from Brazil!
Thank you this made a lot more sense
Hey, thanks so much for your video, you have an excellent way of explaining things. One question to summarize everything; should I only use return when I’m asking a value to a variable?
hey THank You so much ! I was confused about this but now its all clear😃😃
Clear, succint explanation
thank you Estefania !! for this concept , can you make video about vs code also like to configure folders changing drives in vs code etc.... it will be appreciated !!
Hola Estefania, vengo del video de 6 proyectos basicos en Python, gracias por compartir tu conocimiento, ademas que enseñas muy bien, de manera entedible y tienes un tono de voz excelente para enseñar, aprendi mucho de ese video y quiero seguir aprendiendo aca en tu canal, tienes un nuevo suscriptor
Muchas gracias, Luis. 😁 De verdad aprecio mucho tu comentario y me alegra mucho saber que te gustó el curso de Python.
Thank you! Excellent explanation
Great video! Very helpful :)
Thanks alot didi for clearing my doubts.. 😊
I am from India 🇮🇳
super clear! thatnk you
You use the verb return to describe the function return which is just mindblowing to me how someone thinks that kind of introduction is descriptive hahahah
A much needed explanation on this. Thank you 😊 👍
I'm glad you found it helpful. 🙂
Great. Well done. thanks.
this was actually helpful tysm
Your explanation is cleared
Wonderful explain thanks dear 🙏💐
I love your explanation :)
Supongo que entedes el español (porque vi varios comentarios en tu canal escritos en este idioma) asi que bueno, en cualquier caso, muchas gracias, por fin logre entenderlo!! Sos genia, sabelo!
Very Good!!
Hi Estefania..You have a new subscriber..Thanks for simplifiying the return statement. So the variable called results = print(x + y) and a variable is suppose to hold a value not a print statement. Thats why the return statement need to be use to return a value to the variable called results..Correct me if I am wrong
bueno, siempre es bueno una explicación por si a alguien le da esa duda.
Thank you, that helped me.
Thumbs up :)
Hope my playlists will be helpful for you too. Just check and try , most of the Python tutorials (and a R playlist too), with all the files available (see description of the video)
Great video. Could you please explain the following?
"Python function return values must be stored in variables" - False
Hy Estefania this was deeply helpful, but as a review, I think it would be better if you highlighted the last summary on the differences, preferably in written form. but anyways thaanks
thankyou
def add(x,y):
print(x+y)
add(2,3)
its works
Thank you (:
so nice
I Wish mam you will success in life
Good vids
thanks
I'm glad you found it helpful. 🙂
I really crushed on your voice🤧, it's really cool.
also a wonderful video 😇
which code editor is this?
God bless you 🥺🥺🥺
still dont get it
So what happens to the 8 when print is used
If you call a python function that doesn't have a return statement, it will return null
Ok Estefania I like your videos but I have a question that I sent to you on tweeter but no response. how can I make a newline inside the function print in Python? e.g print(num1, num2) how can I make a newline to show num2 appears below num1 inside the same print without having to use one function for each variable, I hope you get my point here. newbie question, my initial solution was: print(num1
, num2) but it doesn't work like that
This actually made me more confused.
4:28
you can't print the output of a code once again, that's the matter i think
no entendi nada
why so many clickup ads
Why am I the only one dumber than everyone. You still went way way way way too fast for me. As if we already knew 90% of what you're talking about.
Tip: There's a Playback Speed option for slow people. You can change the speed of the video there.
you're not the only one😐
The way you explain is more confusing.
This is literally the first way I have understood it finally. Many people have many ways of understanding things.
Easy explanation, thanks a lot sister 👍