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

Комментарии • 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 8 дней назад

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

    • @manishgupt1879
      @manishgupt1879 8 дней назад

      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)

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

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

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

  • @makeupxmaddiee3728
    @makeupxmaddiee3728 5 месяцев назад +1

    Thank you this made a lot more sense

  • @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?

  • @shripadkhandare
    @shripadkhandare Год назад +1

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

  • @talhabedir3812
    @talhabedir3812 9 месяцев назад +1

    Clear, succint explanation

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

  • @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  4 месяца назад

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

  • @Blessuccess
    @Blessuccess 11 месяцев назад

    Thank you! Excellent explanation

  • @aurnaur_itsanamerican5133
    @aurnaur_itsanamerican5133 9 месяцев назад

    Great video! Very helpful :)

  • @nalinisharma1421
    @nalinisharma1421 Год назад +2

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

  • @jdoe4548
    @jdoe4548 Год назад

    super clear! thatnk you

  • @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

  • @toddgilbey3979
    @toddgilbey3979 6 месяцев назад +1

    A much needed explanation on this. Thank you 😊 👍

  • @mohsinfareed1797
    @mohsinfareed1797 Год назад

    Great. Well done. thanks.

  • @zee-zw2gk
    @zee-zw2gk Год назад

    this was actually helpful tysm

  • @jahmanjoe7007
    @jahmanjoe7007 Год назад

    Your explanation is cleared

  • @pratikshasalunkhe1308
    @pratikshasalunkhe1308 Год назад

    Wonderful explain thanks dear 🙏💐

  • @techdoors1799
    @techdoors1799 Год назад +1

    I love your explanation :)

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

  • @clevenielsonvieira5905
    @clevenielsonvieira5905 5 месяцев назад +1

    Very Good!!

  • @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

  • @kuzakani4297
    @kuzakani4297 2 года назад +2

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

  • @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)

  • @liri1189
    @liri1189 Год назад

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

  • @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

  • @catination8443
    @catination8443 2 месяца назад +2

    thankyou

  • @rayyan_060
    @rayyan_060 Год назад +1

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

  • @Pauldieterbrandt
    @Pauldieterbrandt 7 месяцев назад +1

    Thank you (:

  • @nasraldeneisa4172
    @nasraldeneisa4172 Год назад

    so nice

  • @26237
    @26237 4 месяца назад

    I Wish mam you will success in life

  • @ImtaeZ
    @ImtaeZ Месяц назад

    Good vids

  • @aminemohamedannidam9621
    @aminemohamedannidam9621 5 месяцев назад +1

    thanks

  • @MdJameelAhmedJamee
    @MdJameelAhmedJamee Год назад

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

  • @ramprasath-lz9qh
    @ramprasath-lz9qh Месяц назад

    which code editor is this?

  • @Samuel-br6lr
    @Samuel-br6lr Год назад +1

    God bless you 🥺🥺🥺

  • @lokomoko008
    @lokomoko008 5 месяцев назад +2

    still dont get it

  • @riflevisiongaming9921
    @riflevisiongaming9921 11 месяцев назад

    So what happens to the 8 when print is used

  • @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 7 дней назад

    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 8 дней назад

      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.

  • @kanhaiyalalgurjar7813
    @kanhaiyalalgurjar7813 Год назад

    Easy explanation, thanks a lot sister 👍