print() vs. return in Python Functions

Поділитися
Вставка
  • Опубліковано 2 чер 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

КОМЕНТАРІ • 70

  • @bricengono6227
    @bricengono6227 Рік тому +21

    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

    • @simply7712
      @simply7712 5 місяців тому

      If i'm not wrong! It is becoz India like countries have population more than 40-50 European countries

    • @manishgupt1879
      @manishgupt1879 5 днів тому

      ​@@simply7712 indian beginners follow famous tutorial, beginners not search documentation types video (which is great for developer)

    • @manishgupt1879
      @manishgupt1879 5 днів тому

      Beginners like me not know what programming language do and they can not write one line of code

  • @MohamedAhmed-rf5bk
    @MohamedAhmed-rf5bk Рік тому +19

    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

    • @lcarolus
      @lcarolus Місяць тому

      Yep and the variable called "result" cannot hold a print statement (result = print(x + y) It can hold (result = 8)

  • @tosinayodejiayegbusi7003
    @tosinayodejiayegbusi7003 Рік тому +19

    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 💪🏾

  • @maxherrera396
    @maxherrera396 10 місяців тому

    Thank you so much for sharing your knowledge with the rest of us. I highly appreciate it.
    You just got yourself a new subscriber!

  • @adram3lech
    @adram3lech 6 місяців тому +1

    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

  • @IshamCespedes
    @IshamCespedes Рік тому +1

    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?

  • @Maliheh.Hosseini
    @Maliheh.Hosseini Рік тому +2

    Perfectly explained, Thank you.

  • @johannesperez9548
    @johannesperez9548 2 роки тому +1

    Más claro imposible, muchas gracias Estefanía!

  • @eunizelbarrun
    @eunizelbarrun Рік тому +1

    Thank you so much. You explained it very well. I totally understand it now, thank you again.

  • @bagtyyardurdyyev8366
    @bagtyyardurdyyev8366 Рік тому +1

    Simple and easy to understand!

  • @dannyezechukwu1175
    @dannyezechukwu1175 Рік тому +2

    Great video! Idea was communicated clearly!

  • @rsouza_bass
    @rsouza_bass 2 місяці тому +1

    very well explained Estefania...cheers from Brazil!

  • @bhavikvegad3449
    @bhavikvegad3449 2 роки тому +1

    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 !!

  • @Blessuccess
    @Blessuccess 11 місяців тому

    Thank you! Excellent explanation

  • @makeupxmaddiee3728
    @makeupxmaddiee3728 5 місяців тому +1

    Thank you this made a lot more sense

  • @talhabedir3812
    @talhabedir3812 9 місяців тому +1

    Clear, succint explanation

  • @jahmanjoe7007
    @jahmanjoe7007 Рік тому

    Your explanation is cleared

  • @shripadkhandare
    @shripadkhandare Рік тому +1

    hey THank You so much ! I was confused about this but now its all clear😃😃

  • @pratikshasalunkhe1308
    @pratikshasalunkhe1308 Рік тому

    Wonderful explain thanks dear 🙏💐

  • @zee-zw2gk
    @zee-zw2gk Рік тому

    this was actually helpful tysm

  • @mohsinfareed1797
    @mohsinfareed1797 Рік тому

    Great. Well done. thanks.

  • @aurnaur_itsanamerican5133
    @aurnaur_itsanamerican5133 9 місяців тому

    Great video! Very helpful :)

  • @nalinisharma1421
    @nalinisharma1421 Рік тому +2

    Thanks alot didi for clearing my doubts.. 😊
    I am from India 🇮🇳

  • @raven.4815
    @raven.4815 Рік тому

    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!

  • @jdoe4548
    @jdoe4548 Рік тому

    super clear! thatnk you

  • @techdoors1799
    @techdoors1799 Рік тому +1

    I love your explanation :)

  • @luislarrazabal9358
    @luislarrazabal9358 4 місяці тому +1

    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

    • @codingwithestefania
      @codingwithestefania  3 місяці тому

      Muchas gracias, Luis. 😁 De verdad aprecio mucho tu comentario y me alegra mucho saber que te gustó el curso de Python.

  • @lcarolus
    @lcarolus Місяць тому

    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

  • @zii_codes
    @zii_codes Рік тому

    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

  • @liri1189
    @liri1189 Рік тому

    Great video. Could you please explain the following?
    "Python function return values must be stored in variables" - False

  • @toddgilbey3979
    @toddgilbey3979 6 місяців тому +1

    A much needed explanation on this. Thank you 😊 👍

  • @rayyan_060
    @rayyan_060 Рік тому +1

    def add(x,y):
    print(x+y)
    add(2,3)
    its works

  • @clevenielsonvieira5905
    @clevenielsonvieira5905 5 місяців тому +1

    Very Good!!

  • @kuzakani4297
    @kuzakani4297 2 роки тому +2

    bueno, siempre es bueno una explicación por si a alguien le da esa duda.

  • @26237
    @26237 4 місяці тому

    I Wish mam you will success in life

  • @Nekrokon
    @Nekrokon Рік тому +1

    Thank you, that helped me.
    Thumbs up :)

    • @easydatascience2508
      @easydatascience2508 Рік тому

      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)

  • @nasraldeneisa4172
    @nasraldeneisa4172 Рік тому

    so nice

  • @Pauldieterbrandt
    @Pauldieterbrandt 7 місяців тому +1

    Thank you (:

  • @kanhaiyalalgurjar7813
    @kanhaiyalalgurjar7813 Рік тому

    Easy explanation, thanks a lot sister 👍

  • @catination8443
    @catination8443 2 місяці тому +2

    thankyou

  • @MdJameelAhmedJamee
    @MdJameelAhmedJamee Рік тому

    I really crushed on your voice🤧, it's really cool.
    also a wonderful video 😇

  • @ImtaeZ
    @ImtaeZ Місяць тому

    Good vids

  • @ramprasath-lz9qh
    @ramprasath-lz9qh Місяць тому

    which code editor is this?

  • @riflevisiongaming9921
    @riflevisiongaming9921 11 місяців тому

    So what happens to the 8 when print is used

  • @aminemohamedannidam9621
    @aminemohamedannidam9621 5 місяців тому +1

    thanks

  • @Samuel-br6lr
    @Samuel-br6lr Рік тому +1

    God bless you 🥺🥺🥺

  • @lokomoko008
    @lokomoko008 5 місяців тому +2

    still dont get it

  • @angryman5517
    @angryman5517 9 місяців тому

    If you call a python function that doesn't have a return statement, it will return null

  • @pichytechno6782
    @pichytechno6782 Рік тому

    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

  • @jonathanhahka9939
    @jonathanhahka9939 2 місяці тому

    This actually made me more confused.

  • @zihanmubarak1890
    @zihanmubarak1890 5 днів тому

    you can't print the output of a code once again, that's the matter i think

  • @napzonN
    @napzonN Рік тому

    no entendi nada

  • @jangoul
    @jangoul Рік тому

    why so many clickup ads

  • @superpayaseria
    @superpayaseria Місяць тому +1

    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.

    • @Bwekfest
      @Bwekfest Місяць тому

      Tip: There's a Playback Speed option for slow people. You can change the speed of the video there.

    • @faresfbm6061
      @faresfbm6061 5 днів тому

      you're not the only one😐

  • @elchinsir
    @elchinsir Місяць тому

    The way you explain is more confusing.

    • @Bwekfest
      @Bwekfest Місяць тому

      This is literally the first way I have understood it finally. Many people have many ways of understanding things.