How To Use Functions In Python (Python Tutorial #3)

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 มิ.ย. 2024
  • This entire series in a playlist: goo.gl/eVauVX
    Keep in touch on Facebook: / entercsdojo
    Subscribe to my newsletter: www.csdojo.io/news
    Support me on Patreon: / csdojo
    Tips:
    1. Follow along as I explain to make sure you understand everything
    2. Ideally, work with a friend so you can help each other when you’re stuck
    3. If you want to learn faster than I talk, I’d recommend 1.25x or 1.5x speed :)
    4. Check the outline in the comment section below if you want to skip around.
    5. Download the sample files here to follow along (they are Jupyter Notebook files): www.csdojo.io/python3
    6. To make sure you don’t miss my future tutorial videos, sign up to my newsletter: www.csdojo.io/news
    7. Have fun! If anything is unclear, please let me know in a comment.
    Keep in touch on Facebook: / entercsdojo
    Subscribe to my newsletter: www.csdojo.io/news
    Support me on Patreon: / csdojo

ความคิดเห็น • 2.7K

  • @CSDojo
    @CSDojo  6 ปีที่แล้ว +568

    Below is an outline of this video.
    0:41: How to use sample files
    1:41: Using comments
    2:21: What’s a function? - Example 1
    4:57: What’s a function? - Example 2
    7:09: A function that takes multiple arguments
    7:58: What’s a function? - 2 more examples
    10:30: Creating a BMI calculator
    Also, a few tips:
    1. Here is the playlist for this series: th-cam.com/video/Z1Yd7upQsXY/w-d-xo.html
    2. Follow along as I explain to make sure you understand everything
    3. Ideally, work with a friend so you can help each other when you’re stuck
    4. If you want to learn faster than I talk, I’d recommend 1.25x or 1.5x speed :)
    5. Check the outline in the comment section below if you want to skip around.
    6. Download the sample files here to follow along (they are Jupyter Notebook files): www.csdojo.io/python3
    7. To make sure you don’t miss my future tutorial videos, sign up to my newsletter: www.csdojo.io/news
    8. Have fun! If anything is unclear, please let me know in a comment.

    • @namlehai2737
      @namlehai2737 6 ปีที่แล้ว +2

      local host... did you make all that?

    • @Jass_9676
      @Jass_9676 6 ปีที่แล้ว +12

      Love from india
      Helpful videos

    • @harisar17
      @harisar17 6 ปีที่แล้ว +3

      Again i hit like for your video..

    • @gilangvirgiawan2780
      @gilangvirgiawan2780 6 ปีที่แล้ว +1

      Ur something thanks

    • @parveshkhatri7971
      @parveshkhatri7971 6 ปีที่แล้ว +10

      Hi YK ,
      In india we are not taught what we want . There is useless matter in our syllabus. Even many people with master degree in computer science can't create any simple application without any GUI interface help and swing controls. They teach us for marks not for knowledge.
      Should I learn computer science online leaving my school ?

  • @emanjavascript8358
    @emanjavascript8358 4 ปีที่แล้ว +852

    men i watch every advertisement that comes out to my screen just to be fair by teaching us for free..your awesome men

    • @warframeees8013
      @warframeees8013 4 ปีที่แล้ว +22

      Eman JavaScript watching the entire ad wont give him more revenue but a nice act nevertheless

    • @aarohansharma4551
      @aarohansharma4551 4 ปีที่แล้ว +7

      It only gives revenue to TH-cam or something I guess

    • @warframeees8013
      @warframeees8013 4 ปีที่แล้ว +10

      Aarohan Sharma it doesn’t matter how long you watch the ad it’s per view, doesn’t matter if you skip the ad 5 sec in or watch the entirety

    • @katharina...
      @katharina... 4 ปีที่แล้ว +20

      @@warframeees8013 It does matter how long a viewer watches a skippable ad for. If a viewer skips it, the uploader doesn't get paid at all, you have to watch it for 30 seconds or longer for the uploader to be paid.

    • @warframeees8013
      @warframeees8013 4 ปีที่แล้ว +3

      Katharina interesting if thats true

  • @kei7150
    @kei7150 3 ปีที่แล้ว +272

    I'm skipping school to learn coding from this guy and i gotta say it's worth it.. this dude is way better than all of my teachers

    • @mikesierra14
      @mikesierra14 2 ปีที่แล้ว +5

      I am doing this aswell.

    • @ragdoll312
      @ragdoll312 2 ปีที่แล้ว +1

      @@mikesierra14 *im
      Dont ask why

    • @Zainkhan-tk7kt
      @Zainkhan-tk7kt 2 ปีที่แล้ว +25

      @@ragdoll312
      * I'm
      * Don't

    • @mattoucas869
      @mattoucas869 2 ปีที่แล้ว +1

      @@Zainkhan-tk7kt lol

    • @buspsychologist9640
      @buspsychologist9640 ปีที่แล้ว +2

      @@Zainkhan-tk7kt
      * I am
      * Do not

  • @salman2198
    @salman2198 3 ปีที่แล้ว +442

    Hello CS Dojo. I don't know if you are going to read this, but I just passed an Exam in Python because of you! Thank you so much! I spend like 10 hours to watch your awesome lectures :)

    • @mustafaaljanabi4818
      @mustafaaljanabi4818 3 ปีที่แล้ว +28

      Masha Allah! Well done brother!

    • @AS-nx9fu
      @AS-nx9fu 2 ปีที่แล้ว +2

      @ツMoon Owner - Owner of the Moon tf is he typing like that for? 😭💀

    • @joeroganpodfantasy42
      @joeroganpodfantasy42 2 ปีที่แล้ว

      But his lecture are around 3 hours?
      Do you mean total watching and practicing or just watching and rewatching?

    • @salman2198
      @salman2198 2 ปีที่แล้ว +5

      @@joeroganpodfantasy42 Sorry for the late answer. Yes, by re-watching and doing everything by myself twice to get it :)

    • @2kayBaby
      @2kayBaby 2 ปีที่แล้ว +1

      @@AS-nx9fu I deleted that acc 😂. Literally just stumbled upon this. Ig my path has been set in stone

  • @shahin2324
    @shahin2324 3 ปีที่แล้ว +58

    My Professor thinks he's the real shit in Python by creating videos that are 5 hours long just to explain one concept!!!! Now, this is called a real teaching video!!!! short and informative!!!

    • @elkresurgence
      @elkresurgence 3 ปีที่แล้ว +8

      maybe your prof really delved into that concept during those five hours. Short isn't always good, although in the case of this tutorial it is

    • @joeroganpodfantasy42
      @joeroganpodfantasy42 2 ปีที่แล้ว +1

      Maybe if your professor would release his videos on youtube people would appreciate them more.
      I have noticed people tend to dislike what it's offered to them locally or thru a system and they like what they find themselves online.

    • @t345m
      @t345m หลายเดือนก่อน

      At least yours tries my professor gives us half examples and then stops teaching 30 mins in. The class is supposed to be 3 hours! Be happy that he actually cares, unlike mine.

  • @ammarahmed8155
    @ammarahmed8155 4 ปีที่แล้ว +411

    I started watching these tutorials yesterday and I figured out by myself how to use these functions to create a program to solve the quadratic formula. I know thats probably nothing for coders but I feel really accomplished and if anyone wants to see the code I can send it to you over email. I just feel really accomplished and I wanna share it with someone. This guy is such a good teacher.

    • @gabz8469
      @gabz8469 4 ปีที่แล้ว +5

      Hi Ammar
      Would you be able to send the code to geebee71@hotmail.com please?
      Appreciated..Thanks

    • @YashSharma-nm1zc
      @YashSharma-nm1zc 4 ปีที่แล้ว +2

      Pls share me codes

    • @oblivious7045
      @oblivious7045 4 ปีที่แล้ว +54

      Why don't you just post it in the comments?

    • @Aminhirari
      @Aminhirari 4 ปีที่แล้ว +18

      Be careful it’s a virus torchan

    • @ykyk7771
      @ykyk7771 4 ปีที่แล้ว +30

      Post it here bruh

  • @dhruvalraval8078
    @dhruvalraval8078 6 ปีที่แล้ว +319

    You are being so helpful. Please continue with this series of python

  • @thatwakandaboy
    @thatwakandaboy 2 ปีที่แล้ว +31

    I am 4 years late to this channel and 43 years late to Programming, but I am enjoying every minute of this series. Thanks YK and the entire CS Dojo team.

    • @Addistoday
      @Addistoday ปีที่แล้ว

      😂😂😂😂😂😂😂 same here,Things happen at Gods will time. enjoy❤❤❤❤ much love from Ethiopia🇪🇹

  • @youdonthaveto
    @youdonthaveto 2 ปีที่แล้ว +11

    You are so helpful. I've grown up in a broke family and I don't have any money to buy course for learning Python. Your videos mean a lot to me. Thank you so much Dojo

    • @FirepowerIGuess
      @FirepowerIGuess ปีที่แล้ว +2

      I'm so glad people like CS are making these tutorials for free, genuinely. I hope you're in a more financially stable condition now than before.

  • @keerthanaanandan6062
    @keerthanaanandan6062 4 ปีที่แล้ว +752

    Def comment1():
    print("thanks for teaching me")
    print("thanks once again")
    Comment1()

    • @rickydawn6313
      @rickydawn6313 4 ปีที่แล้ว +6

      Input Error missing Positional input

    • @allipse8224
      @allipse8224 4 ปีที่แล้ว +1

      @@puchu_5001 same

    • @oussematoussli8085
      @oussematoussli8085 4 ปีที่แล้ว +4

      Comment 1() should be comment1() not with the Capital letter

    • @jinsonthekkan7420
      @jinsonthekkan7420 4 ปีที่แล้ว +3

      D should be also small letter

    • @KS_Harshith
      @KS_Harshith 4 ปีที่แล้ว +11

      def comment1():
      print("thanks for teaching me")
      print("thanks once again")
      print(comment1())
      # this is the correct code

  • @tradeviper874
    @tradeviper874 5 ปีที่แล้ว +325

    Well, out of all of the different, gazillion sites and videos I have paid for and not paid for, you are, in the 61 yr olds opinion, The Best. Knowing what you are doing, and Teaching, are two different skill sets. In my business, just because you have intellect and mental ability, does not mean you will make money. You are doing quite well, starting with a base concept, then giving a practical example, then breaking it down to show how it works. Outstanding job, young man just outstanding. Also, Kudos on your English, bring multilingual myself, it can be a daunting task at times, but you have also done well here. Keep up the good work and I look forward to seeing your future success, by the way, maybe a paid forum might help keep a roof over your head? :)
    The Ever Kudoing VIPER

    • @zumzumwater3018
      @zumzumwater3018 5 ปีที่แล้ว +4

      Hey Trade, My dad is 65, and his typing speed is 11wpm, anything below 30 is considered very slow. How do I get my dad to stop acting like such an old man?

    • @rickydawn6313
      @rickydawn6313 4 ปีที่แล้ว +12

      @@zumzumwater3018 Viagra gives you wings.

    • @PeterLucasathome
      @PeterLucasathome 4 ปีที่แล้ว +7

      @Trade Viper, I endorse your comments. At 71, I am learning to code thanks to this young man. He is doing an excellent job. Last time I did any coding was back in the 80's, when if you couldn't write a little BASIC, you couldn't get a computer to do anything. @CS Dojo , you deserve success!

    • @HHTP6
      @HHTP6 3 ปีที่แล้ว

      dont worry grandpa this video alone can get 15 months of rent

    • @AnonymousXvictoriouS
      @AnonymousXvictoriouS 2 ปีที่แล้ว

      @@zumzumwater3018 he is an old man

  • @3niracer
    @3niracer ปีที่แล้ว +12

    Learned more from you in an hour than 2 weeks of a course. Thanks for taking the time and effort. Much appreciated 🙏🏽

  • @epiccownerdfighter
    @epiccownerdfighter 2 ปีที่แล้ว +13

    I know this is an old vid I'm commenting on, but you earned an instant sub (well, after 3 videos). Informative, understandable, well presented, quick. Great stuff for a beginner like me!

  • @legal827
    @legal827 6 ปีที่แล้ว +40

    I absolutely love your videos. My father inspired me to learn programming, as in the past I’ve learned some but I’ve gathered a lot of laziness towards programming because of a lot of heavy school work. My father encourages me to just read the documentation and learn Python piece by piece, but I find that boring and hard to follow.
    Your videos keep me going and they are professional and clear. Instead of buying courses on Udemy, I just use your courses and they’re amazing. Thank you so much.

  • @milittt
    @milittt 3 ปีที่แล้ว +70

    The best part:
    Running a code without error 😑😑😑

    • @AQ-101
      @AQ-101 2 ปีที่แล้ว

      @Loai Alghamdi yes 😁

  • @dansmith9406
    @dansmith9406 ปีที่แล้ว

    5 years later and this video is still amazing! You just helped a total noob complete part of the cs50 course with this video. I had no idea how to do mapping with a function. Perfect explanation. Thank you

  • @TheNewTravel
    @TheNewTravel 3 ปีที่แล้ว +197

    I was hoping you would go back and add the "is" before "not overweight', it was driving me crazy haha. Great video :)

    • @phamgiaminh6496
      @phamgiaminh6496 3 ปีที่แล้ว +3

      You are learning Python, too? =))

    • @ivanreyes7770
      @ivanreyes7770 3 ปีที่แล้ว

      Tks i already do it

    • @PNCNDNOB
      @PNCNDNOB 3 ปีที่แล้ว

      haha same here.. i did it on my end tho.. lol

    • @oskarwitha_k8258
      @oskarwitha_k8258 3 ปีที่แล้ว +1

      Wdym, he did change it

  • @alandempsey7234
    @alandempsey7234 6 ปีที่แล้ว +3

    These videos are great. I like the way you organize and outline the tutorial at the beginning.

  • @kennethchin278
    @kennethchin278 4 ปีที่แล้ว +3

    I thought the overview of functions was excellent. Covering what one can use functions for, quickly and concisely, ( be it mappings and returning calculations. ) as well as using of strings. Much appreciate. I've watched a few online Python vidoes and it's nowhere near as sysynced and easy to understand with useful examples as yours. Keep up the good work.

  • @mashiburrahmankhan2584
    @mashiburrahmankhan2584 4 ปีที่แล้ว

    This is the best Python video so far. Your whole playlist is also extremely helpful. I tried to find other beginners python videos but yours is THE BEST, very well explained and elaborated! Great job!

  • @joemorris6544
    @joemorris6544 3 ปีที่แล้ว

    I have been following along with Python Crash Course book in my spare time and anytime I get stuck on a problem or don’t quite understand what I’m doing I always come to your channel.
    This video helped me understand functions a lot more.

  • @abdulkhadir4498
    @abdulkhadir4498 ปีที่แล้ว +7

    For those who want to write a quadratic equation, I wrote a code and felt I should share this. So here is the code:
    def function2(x):
    a=2
    b=3
    c=4
    return a*(x**2)+b*x+c
    value_of_my_equation=function2(-2.2)
    print(value_of_my_equation)
    Note: you can assign any value for x inside the parentheses beside value_of_my_equation=function2 and any values to a,b,c.

  • @kelloginc1
    @kelloginc1 5 ปีที่แล้ว +3

    Literally the best function video on youtube, thank you!

  • @RAiiNMAKER_
    @RAiiNMAKER_ 3 ปีที่แล้ว +1

    Your tutorials are helping me understand the basics of python so quick. I really appreciate everything on your page. Thank you!

  • @emmanuelpierre8856
    @emmanuelpierre8856 ปีที่แล้ว +2

    Hey YK, I from Canada, Québec, Gatineau and I speak french more than english. I am an absolute beginners on python (leaning how to code). I want to let you know that all your Python tutorial are well explained and I love following your courses cause you take your time to explain step by step and I found this a great quality and skills you have. Keep continue what you do, teaching us, sharing your knowledge and more. Your great energy will bring you where ever you want and you will get what ever you need to accomplish your goals. 👍

  • @siddhijha894
    @siddhijha894 6 ปีที่แล้ว +187

    YK 😁😍 thank u and keep working over it ,u r an awesome teacher 😂

    • @ankixsounds
      @ankixsounds 6 ปีที่แล้ว

      Siddhi Jha hi

    • @aakilahmed8649
      @aakilahmed8649 5 ปีที่แล้ว +1

      an awesome teacher tho

    • @ryz3nplayz364
      @ryz3nplayz364 4 ปีที่แล้ว

      no not awesome... ITS THE BEST teacher

  • @noflare1714
    @noflare1714 3 ปีที่แล้ว +100

    You cannot imagine the amount of joy I felt when I converted km to miles😂😂😂😂

    • @chernobylcoleslaw6698
      @chernobylcoleslaw6698 3 ปีที่แล้ว +10

      Nah I scream for joy when I nail some code; even if it is basic af.

    • @celineangelina2697
      @celineangelina2697 3 ปีที่แล้ว +3

      howw? can you post it here?

    • @ShreyasV0
      @ShreyasV0 3 ปีที่แล้ว +7

      @@celineangelina2697
      def convert(miles):
      print(1.6*miles)
      miles = int(input("Enter miles :"))
      convert(miles)

    • @MinotaurvsCyclops
      @MinotaurvsCyclops 3 ปีที่แล้ว +3

      @@celineangelina2697 KM to MILES (my way):
      def convert(miles):
      km = miles / 1.6
      print(f"This is the amount in miles {km}")
      miles = float(input("Enter KM here: "))
      convert(miles)

    • @eleenasen4290
      @eleenasen4290 3 ปีที่แล้ว +2

      @@chernobylcoleslaw6698 OMG same I was like YASSS IM NOT DUMB lolol

  • @evelyn-ed7nn
    @evelyn-ed7nn ปีที่แล้ว +1

    I think what is insane is that these videos were made in 2018 and I'm sitting here on the same program in 2022 and it still looks the same, still works the same, it's just so easy to use; it's incredible.

  • @lovathon6365
    @lovathon6365 ปีที่แล้ว +2

    I've been self studying using another website where I bought a course on sale, and I have been struggling so much with functions that I even stopped for 2-3 weeks because I just felt so dumb that I couldn't grasp what was being asked of me... this video broke it down so nicely that after so long I'm finally able to grasp what was being said all along. thank you for making this video, it has brought me back to coding!!

  • @elmo890
    @elmo890 4 ปีที่แล้ว +12

    miles = int(input())
    def convert(miles):
    print("KM:")
    return miles*1.6
    km = convert(miles)
    print(km)
    Asks to type in miles when run, converts input to KM. Or remove int(input()) and set miles = "amount of miles"

    • @KokkuBhanuprakash
      @KokkuBhanuprakash 3 ปีที่แล้ว

      excellent bro😱😱😱😱

    • @guiantony
      @guiantony ปีที่แล้ว

      miles = int(input())
      def convert(miles):
      print("KM:", end="")
      return miles*1.6
      km = convert(miles)
      print(km)
      (with it stays in the same line :) )

  • @lzcracker
    @lzcracker 5 ปีที่แล้ว +12

    This is the most clear, concise explanation of python I've found, thank you so much for the hard work. :)

  • @fryaadil1687
    @fryaadil1687 2 ปีที่แล้ว +1

    Just started learning Python as a hobby. I have no programming experience but I am really enjoying it so far. Thanks, man.
    Your teaching method is really good.

  • @juppukun
    @juppukun 4 ปีที่แล้ว

    Your tutorials are outstanding. You make learning this so much more easier by looking at your videos and trying them on my end. I'm in my second semester of IT security and Networking and this makes it so much more fun to learn and use Python and I am stupid as far as coding goes.
    Thank you!

  • @paulovinicius5833
    @paulovinicius5833 5 ปีที่แล้ว +9

    Best functions classes I've ever seen. Congrats!

    • @geniushalo5473
      @geniushalo5473 4 ปีที่แล้ว

      You mean "Thanks"?

    • @RealSpyduh
      @RealSpyduh 3 ปีที่แล้ว +1

      @@geniushalo5473 ahahahahah yeah i think thats what he meant XD

    • @geniushalo5473
      @geniushalo5473 3 ปีที่แล้ว

      @@RealSpyduh Yeah xd. Its kinda wierd to congratulate someonw

    • @delubiod1970
      @delubiod1970 3 ปีที่แล้ว +1

      @@geniushalo5473 We Brazilians Congratulate everyone who does that extra mile when teaching. He deserves to be Congratulated. Don't you think?
      Teaching is hard. When someone teaches a topic so easy, just thanking him will sound like an understatement to his effort, I guess....

  • @Akuphakpa
    @Akuphakpa 6 ปีที่แล้ว +5

    Finally i got this video. I has been waiting from your last video(if else statement )thank you so much yk ..

  • @paulmulderry3788
    @paulmulderry3788 4 ปีที่แล้ว +1

    Thanks for taking the the time to explain syntax in python tutorials. I find your approach to teaching encouraging.

  • @WNFpker
    @WNFpker 4 ปีที่แล้ว +1

    I’m so grateful for finding your channel. Thank you !

  • @richardd5587
    @richardd5587 3 ปีที่แล้ว +4

    Really good series. Thought I'd dip into Python as it's the language used in my nephew's school and he will be taking Computer Science next year. As a retired Science teacher with a lot of experience coding in VB and VBA I've found the presentations very clear and rarely miss a trick (like the importance of the number of leader spaces!). Although I was using PyCharm I now think the Jupyter IDE has the edge for younger students.

  • @am_sf6574
    @am_sf6574 3 ปีที่แล้ว +10

    Def convert(x):
    Return x * 1.6 + " km"
    Km = convert(5) #5 miles
    Print Km

    • @khytron06
      @khytron06 3 ปีที่แล้ว +3

      And you can also ask the user for an input :
      def convert(x):
      print(x*1.6+"km")
      a=int(input("Distance(miles): "))
      convert(a)

    • @builder481
      @builder481 2 ปีที่แล้ว +4

      def convert(m):
      return m * 1.6
      km = convert(8)
      print(km)
      I also made this it convert feet to cm
      def hight(length):
      return length * 30.48

      tallinCm = hight(6.4)
      print(tallinCm)

  • @ByAnyMeansNecessary.
    @ByAnyMeansNecessary. 4 ปีที่แล้ว +1

    I was having trouble grasping these concepts through Codecadamy but you cleared it all up for me. Subscribed. looking forward to checking out your other videos. Thanks.

  • @scorpiomischief
    @scorpiomischief 3 ปีที่แล้ว

    I have been on app after app and watched tutorial after tutorial, but this is the first video I've seen that explained things clearly and directly using simple terms I could understand. I'm going to be a subscriber of yours forever now! You definitely have a gift for teaching. So many folks in computer science (even if they're brilliant coders) have difficulty explaining their process in a concise way. So thank you; you're a life saver! I'm going to go turn off my adblock now and re-watch this in gratitude :)

  • @shubhamkawade317
    @shubhamkawade317 4 ปีที่แล้ว +5

    so it's dec 2019, i know i'am late, but you saved me. thank you so much!

  • @TrangTruong-od5so
    @TrangTruong-od5so 6 ปีที่แล้ว +3

    Thank YK for your useful Python tutorial ✨
    A big thank from Vietnam 😄

  • @uriellopez5438
    @uriellopez5438 3 ปีที่แล้ว +1

    I am starting to learn coding and this tutorial has helped me a lot , thanks CS Dojo . keep up the good work

  • @nighthawk_1
    @nighthawk_1 3 ปีที่แล้ว

    Thank you CS Dojo! I have been looking for a channel that I would find someone that speaks clearly and detailed about the subject.

  • @adzefeabdulraman652
    @adzefeabdulraman652 5 ปีที่แล้ว +6

    I have been missing a lot.I just subscribed to your channel yesterday. I'm enjoying it.God bless you

  • @droidzz4935
    @droidzz4935 5 ปีที่แล้ว +28

    Here is the function:
    def convert(miles):
    km = 1.6 * miles
    print("km: ")
    print(km)

    • @zz-nj1bq
      @zz-nj1bq 4 ปีที่แล้ว

      ok

    • @ThErrandBoy
      @ThErrandBoy 4 ปีที่แล้ว +3

      @akash anil he's not wrong, you just have to call the function cos he didn't assign it to a variable (since he used print and not return.) and he should have said km = 1.6/miles not 1.6*miles.

    • @michaelegiebor524
      @michaelegiebor524 3 ปีที่แล้ว

      Should have used return argument instead

    • @rahmats.8913
      @rahmats.8913 3 ปีที่แล้ว

      it's not a function

    • @droidzz4935
      @droidzz4935 3 ปีที่แล้ว

      @@rahmats.8913 ?

  • @AAsisters84
    @AAsisters84 3 ปีที่แล้ว

    After searching on TH-cam for 30 minutes, This video was the only one that really helped me understand how to use the functions. Thx a lot.

  • @bartkornacki3590
    @bartkornacki3590 3 ปีที่แล้ว

    CS Dojo you put things into the plain explanation-something that the other tutorials lack

  • @denverbaumgartner562
    @denverbaumgartner562 6 ปีที่แล้ว +3

    Hey YK love the videos. I really enjoyed the opportunity for a practice problem at the end. I was wondering if in the future you could possibly have more breaks after writing a string? I have two windows open to go between coding and watching and often have to pause to catch up as I am not as fast a typer as you. Thanks and keep the videos coming!

    • @aadithya6969
      @aadithya6969 5 ปีที่แล้ว

      i am doing the same as well

  • @vasileafloarei251
    @vasileafloarei251 5 ปีที่แล้ว +12

    def functie_km(km):
    return 1.6 * km
    print("conversis km in mile")
    a = functie_km(4)
    print(a)

    • @pranithsukhavasi2502
      @pranithsukhavasi2502 4 ปีที่แล้ว +1

      return 0.6*km(correction)

    • @am_sf6574
      @am_sf6574 3 ปีที่แล้ว

      @@pranithsukhavasi2502 it's not 0.6 though

    • @Dark_dragon1212
      @Dark_dragon1212 11 วันที่ผ่านมา

      why not just do
      def convert(miles):
      print("converted km in miles")
      return 1.6*miles
      convert(4)
      I assume conversis is a synonym for convert or converted.

  • @nzehemmanuel3774
    @nzehemmanuel3774 ปีที่แล้ว +1

    I’m Emmanuel from Ghana and I was thinking about how to start my semester Computer programming. I didn’t know what to do but from the fews videos I have been watching from your site . I very motivated to do this course. Thank you soo much for giving me this foundation 🙏🙏

  • @sekytwo
    @sekytwo 3 ปีที่แล้ว

    These are the best videos on how to learn Python. Love these videos bro, thank you.

  • @shashiverma6219
    @shashiverma6219 6 ปีที่แล้ว +21

    Love from India bro..I learned PHP year ago ..and at that time I was keen to learn python..but didn't happened.. I did 2 months job as PHP developer in a small company..I left..coz i thought it's not that's I want..but after watching ur another videos and that python series..I think I can do this..thanks for uploading the videos ..and keep uploading bro..thank you so much brother.

    • @diogo8386
      @diogo8386 5 ปีที่แล้ว +1

      Hey man, how many time you took to learn php and to get the job?

    • @OsadeTOOT
      @OsadeTOOT 5 ปีที่แล้ว

      i thought you said "love you indian bro" lol

  • @TrueMathSquare
    @TrueMathSquare 6 ปีที่แล้ว +7

    Thanks this is great.

  • @jieweikwan
    @jieweikwan 4 ปีที่แล้ว +1

    Hello YK! Just wanted to say I hardly had any interests in other videos - eg from Coursera as they were usually not straight to the point. But your videos keep me going n the step by step allows me to imprint the steps into my head! I think this is really important for someone who can’t listens to Long lectures and am really thankful to have found your video 🥺

  • @badassadlusifer820
    @badassadlusifer820 3 ปีที่แล้ว +1

    This was rather complex than i anticipated but actually learnt alot of things. Thx man

  • @franndyabreu6272
    @franndyabreu6272 6 ปีที่แล้ว +3

    The wait is over!

  • @sanjanamun1452
    @sanjanamun1452 5 ปีที่แล้ว +3

    got inspired from your tutorial!! i'm loving python

    • @hassanrezve7269
      @hassanrezve7269 3 ปีที่แล้ว +1

      so are u a programmer now?

    • @Dark_dragon1212
      @Dark_dragon1212 11 วันที่ผ่านมา

      it now being 5 years since, I too and invested in the idea of whether or not you may be a programmer now.

  • @ThinboxStudios
    @ThinboxStudios 4 ปีที่แล้ว +2

    This video helped me understand functions for my intro python class! Thank you very much!!!! you explain it better than a textbook does in 400 pages ROFL.

  • @edgarvargas3922
    @edgarvargas3922 3 ปีที่แล้ว

    KJ ! My man! The struggle is real in my fintech bootcamp,(atleast for me) your videos help me understand the concepts sooo much better! Thanks for the awesome teaching material.

  • @shree2710
    @shree2710 6 ปีที่แล้ว +123

    Its like waiting for the new episode of your favourite anime, only the difference is that you dont know when the new episode is gonna be dropped.

    • @Ahmedcoday
      @Ahmedcoday 6 ปีที่แล้ว +2

      loooool

    • @rakotai9998
      @rakotai9998 5 ปีที่แล้ว

      LMAO! i am currently watching Kenja no maga , Kimitsu no yoba , fairy tale: final season and thats all

    • @77shaiksultan
      @77shaiksultan 4 ปีที่แล้ว +1

      You can't compare anime with this

    • @kennyg1953
      @kennyg1953 4 ปีที่แล้ว

      Idk man I've been waiting for Naruto Ep 501 for a while.

    • @Red-yq6nc
      @Red-yq6nc 4 ปีที่แล้ว +1

      @@@kennyg1953 Fam naruto is over, now they have a half assed series named boruto which is basically like naruto filler but its cannon

  • @xmisteralex
    @xmisteralex 3 ปีที่แล้ว +6

    I did:
    def convert(miles):
    return 1.609*miles
    km=convert(150)
    print("km =",km)
    km = 241.35

  • @shreyashkashyap
    @shreyashkashyap 3 ปีที่แล้ว +1

    I actually liked it very much! Also the sound of your keyboard is very pleasing>.

  • @supersoniq4102
    @supersoniq4102 ปีที่แล้ว

    I was having a tough time understanding Functions from my other teachers since i'm new to .py. In Less than a Minute you've made it seem like ABC. You are a genius!!

  • @agamgujral5696
    @agamgujral5696 4 ปีที่แล้ว +9

    I did:
    def km(x):
    return (1.6 * x)
    Miles = km(20)
    print(miles)
    32

    • @khalanesachin
      @khalanesachin 3 ปีที่แล้ว +2

      Yours is also right but you managed it little differently than he asked ..
      What he is expecting (in my opinion) is as follows...
      def convert(miles):
      return miles*1.6
      km = convert(100)
      print(km)
      160.0
      Which means 100 miles= 160km

    • @TollpatschZ123
      @TollpatschZ123 3 ปีที่แล้ว

      @@khalanesachin Yeah makes more sense that way. Thanks for sharing.

  • @Rinaa966
    @Rinaa966 ปีที่แล้ว +5

    My solution ^^
    def convert(mile):
    km = mile * 1.60934
    return str(mile) + " mile is equal to " + str(km) + " km"

    • @rafnael8807
      @rafnael8807 ปีที่แล้ว +3

      just add the print(convert(x)) statement

    • @pharmacist2576
      @pharmacist2576 ปีที่แล้ว

      @@rafnael8807 what about:
      def miles_km_converter(km, miles):
      km = 1.6 * miles
      print("km ")
      print(km)
      miles = 5
      miles_km_converter(km, miles)

  • @SharkWitchMeruna
    @SharkWitchMeruna 4 ปีที่แล้ว +1

    I had to watch this a few times but I think I got it! Thank you!

  • @leahjespersen1698
    @leahjespersen1698 2 ปีที่แล้ว

    This is incredible and much easier to understand than my online courses! Thank you thank you!!

  • @anemawbishaw2827
    @anemawbishaw2827 3 ปีที่แล้ว +3

    It's harder than i thought 😨

  • @AntiagingVideos
    @AntiagingVideos 4 ปีที่แล้ว +5

    Hi dojo and thank you for the great tutorial. When you say
    "a function is a collection of structures". What is a structure?
    Thank you!

  • @alexisdelgado8737
    @alexisdelgado8737 2 ปีที่แล้ว

    THANK YOU I am taking a machine learning course this fall and I currently am learning python still and you explain so well i am learning so fast

  • @shudanhao8643
    @shudanhao8643 2 ปีที่แล้ว +1

    Thank you so much. i am a new learner of python, the return and function are really confusing for me. This video perfectly explained them for me.
    Keep up the good work!!!

  • @orthodox8224
    @orthodox8224 5 ปีที่แล้ว +7

    def convert(miles):
    print(1.6*miles)
    miles = int(input("Enter miles :"))
    convert(miles)

    • @brasoveanuionut3207
      @brasoveanuionut3207 3 ปีที่แล้ว

      And what if i input 10.7 ? Answer : Not working, Xd

  • @devonchin94
    @devonchin94 5 ปีที่แล้ว +4

    def convert(miles):
    return miles*1.6
    km = convert(int(input("Enter miles here: ")))
    print(str(km) + " km")
    I decided to take it one step further with the challenge. Allow a user input to convert miles to km, and convert that integer to a string to show the km after the value!
    Thanks so much for these videos! I am absolutely loving learning python3 (my first programming language). And having passionate people recording tutorials like this really helps more than I could ever put into words!

    • @rakotai9998
      @rakotai9998 5 ปีที่แล้ว

      honestly i did the same thing the reason i took a step further was cuz the actual challange was too easy and tried to make a user type the miles and it convertes it to km and i was bout to paste the code in here but guess I was slow. LMAO you got me.

  • @YuriDob
    @YuriDob 4 ปีที่แล้ว +1

    This is great man, im writing my own functions with ease!!! Did the last KM convert problem in less than 1 min. Really awesome, thanks you

    • @rockylizardi-brown1029
      @rockylizardi-brown1029 3 ปีที่แล้ว +1

      How did you do it, it was causing me trouble, but I’m rewatching the video the now

    • @YuriDob
      @YuriDob 3 ปีที่แล้ว +1

      @@rockylizardi-brown1029 keep trying, you must be doing something minor wrong

  • @JMac1313
    @JMac1313 2 ปีที่แล้ว

    Just getting started trying to learn programming and these videos have been very helpful!! Thanks

  • @evelynwang4818
    @evelynwang4818 3 ปีที่แล้ว +3

    wow i learned more in the first 3 vids than i did taking a four week summer camp python course. thank you so much ! im in eighth grade and this understandable even for beginners.

  • @oleksandrherasymenko3167
    @oleksandrherasymenko3167 5 ปีที่แล้ว +23

    So love your "Ahhhhh" stuff.

  • @Ghost-yf6uf
    @Ghost-yf6uf 4 ปีที่แล้ว

    Thank you so much. Your videos are awesome i haven't ever seen such a great tutorial.

  • @user-xo5qt4oo7t
    @user-xo5qt4oo7t 4 ปีที่แล้ว

    Great tutorial I was watching another full python tutorial but kind of don't get it but your explanation helped me a lot
    Thank you very much

  • @PNCNDNOB
    @PNCNDNOB 3 ปีที่แล้ว +5

    learning so much here, i am going to get a official course on Pyhton (because i have to do some studies or work from the government here in the Netherlands), so i think that is going to be way easier now.. thanks a lot! as soon as i get a job again i am donating some money to you bro!!

  • @xxss97ssxx
    @xxss97ssxx 4 ปีที่แล้ว +4

    mil = input("Enter miles: ")
    miles = float(mil)
    def convert(miles):
    km = 1.6 * miles
    return km
    conversion = convert(miles)
    print(conversion)

    • @alokpatnaik692
      @alokpatnaik692 4 ปีที่แล้ว

      1 mile = 1.6 km
      So 1 km = 1 mile/1.6

    • @KrolPower
      @KrolPower 4 ปีที่แล้ว +1

      You can also combine your first two lines to simplify and organize a bit better. Ex:
      miles = float(input("Enter miles:"))
      That way you don't have an extra variable to keep track of.

    • @elantris-2002
      @elantris-2002 3 ปีที่แล้ว +2

      @@KrolPower I did it like this lol xD
      x = 1.6
      def c1 (x, y):
      return 1.6*y and print (1.6*y)

    • @KrolPower
      @KrolPower 3 ปีที่แล้ว

      @@elantris-2002 lmao

    • @elantris-2002
      @elantris-2002 3 ปีที่แล้ว +2

      @@KrolPower but it works 😂

  • @miguelconstantino-guzman7957
    @miguelconstantino-guzman7957 3 ปีที่แล้ว

    Thank you! It is better to watch this than the reading I spent hours on. I just needed to understand what it's like to use arguments. It wasn't clear to me in the beginning of my class!

  • @jeffrey8154
    @jeffrey8154 3 ปีที่แล้ว

    Your tutorial is amazing clear and detailed, really amazing work.

  • @xodiaki
    @xodiaki 3 ปีที่แล้ว +3

    my solution:
    miles = int(input("Enter the amount of miles you'd like to convert :"))
    def convert(miles):
    return miles * 1.6
    km=convert(miles)
    print(km)
    kms=int(input("enter the amount of kms you'd like to convert :"))
    def convet_km(kms):
    return kms/1.6
    mile=convet_km(kms)
    print(mile)

    • @rinovichaz3168
      @rinovichaz3168 3 ปีที่แล้ว +1

      If you convert your input as float instead of int it will be more accurate i think. I tried ur code using the input of 100.99999 an the conversion was a little off... using a float instead of an integer will not ignore decimals and therefore will give you the most accurate result. But ur code helped me out a little so thanks

    • @xodiaki
      @xodiaki 3 ปีที่แล้ว

      @@rinovichaz3168 you're welcome and yes float will work better !

    • @Strawhaty
      @Strawhaty 3 ปีที่แล้ว

      @@xodiaki surely your code would work without the miles? why use them??

    • @xodiaki
      @xodiaki 3 ปีที่แล้ว

      @@Strawhaty what do u mean lol

  • @Cmog884
    @Cmog884 3 ปีที่แล้ว +54

    I feel like I can remake skyrim

    • @rdenel7126
      @rdenel7126 3 ปีที่แล้ว +5

      killleeed me xDDDDDD
      I FELT LIKE I COULD FIX CYBERPUNK GLITCHES

    • @levnikitin7432
      @levnikitin7432 3 ปีที่แล้ว +2

      @@rdenel7126 damn i think even for world's most infamous coders fixing cyberpunk would be difficult

    • @cybernerd7492
      @cybernerd7492 3 ปีที่แล้ว +2

      Yes

    • @matmattarayao1277
      @matmattarayao1277 3 ปีที่แล้ว

      @@cybernerd7492 sup cyberfucked

    • @cybernerd7492
      @cybernerd7492 3 ปีที่แล้ว

      @@matmattarayao1277 sup dog😎

  • @fiona8731
    @fiona8731 3 ปีที่แล้ว +1

    I used to not be able to figure out what functions were for. Thanks to you, now I know!

  • @Call.Me.Sly.
    @Call.Me.Sly. 3 ปีที่แล้ว

    I should have known you a little earlier...You're the best and now I wanna take a course in python, I was here doing it for fun but you've inspired me.

  • @72prabhatkumar91
    @72prabhatkumar91 6 ปีที่แล้ว +13

    Sir i am big fan u......i have watched your all video....thanx

    • @gabrielmoreno3027
      @gabrielmoreno3027 5 ปีที่แล้ว +5

      PRABHAT KUMAR now watch some english tutorials, thank you.

    • @peyushbht7982
      @peyushbht7982 5 ปีที่แล้ว

      lmao

    • @ajithsdevadiga1603
      @ajithsdevadiga1603 5 ปีที่แล้ว

      @@gabrielmoreno3027 as if you are from Oxford 🤣🤣

    • @gabrielmoreno3027
      @gabrielmoreno3027 5 ปีที่แล้ว +1

      @@ajithsdevadiga1603 Oxford = English??? XDDD are you kidding me

  • @Chucky5525
    @Chucky5525 4 ปีที่แล้ว +4

    My miles to kilometer converter:
    def convert(miles):
    return 1.6 * miles
    def temp(x):
    return 1 * x
    a = convert(4)
    x = 4
    print(x)
    print(a)
    print(x, "miles is", a, "km")

  • @HipsterBrooo
    @HipsterBrooo 7 หลายเดือนก่อน

    Bro I feel like I've browsed through a gazillion videos on Functions and only this video helped me. THANKS A TON😭

  • @adnanarnautovic3541
    @adnanarnautovic3541 4 ปีที่แล้ว

    If I ever get into engineering and finsihin that faculty bro i wil remember u as my Hero ! I saw others doing tutorials and seeing u Congrats bro u are the one !

  • @pilgrim273
    @pilgrim273 4 ปีที่แล้ว +4

    print('hello yk')
    name = tom
    print(name)
    print('here and i want to thank you for the videos you create which are much better than how my teachers teach at school'')

  • @hashpants8034
    @hashpants8034 6 ปีที่แล้ว +64

    Could you please explain RETURN in more detail please.

    • @swallowedinthesea11
      @swallowedinthesea11 6 ปีที่แล้ว +17

      Return value gets stored and saved into a variable.
      def addSum(num, num2):
      return num + num2
      answer = addSum(500, 100)
      # answer = return 500 + 100
      # answer = return 600
      # variable answer is now equal to the return value 600.

    • @koconutto
      @koconutto 6 ปีที่แล้ว +11

      I Didnt understand return very good

    • @WhoForgot2Flush
      @WhoForgot2Flush 6 ปีที่แล้ว +21

      If anyone still needs helps, just think of a return as the value of the function. For instance at the end when he writes...
      km = convert(miles)
      you know the "convert" function will need to return something, can be an integer or a string or anything, because you are storing the returned value of the function to a variable. If you did not have a return in the convert method you would not be able to store it to a variable. Inside this function would be...
      return 1.6 * miles
      if you didn't put the return there it would still execute the code but you would not be able to say km = convert(mile) since the function would not be returning anything.

    • @KlimYadrintsev
      @KlimYadrintsev 6 ปีที่แล้ว +1

      Mike Naples thanks

    • @KlimYadrintsev
      @KlimYadrintsev 6 ปีที่แล้ว

      11swallowedinthesea thanks

  • @Sam-uc2qh
    @Sam-uc2qh 2 ปีที่แล้ว

    this is probably the best video explaining functions that i can find on the internet!

  • @satokuX
    @satokuX 3 ปีที่แล้ว

    Very good video, very well explained, and I was able to do the miles to kilometers converter using just your explanation, thank you very much

  • @pt-tutorials4293
    @pt-tutorials4293 6 ปีที่แล้ว +3

    I love ur videos , but there is a question how did u know that after the print("ahhhh ahh 2" ) the function1 has ended

    • @rickydawn6313
      @rickydawn6313 4 ปีที่แล้ว

      What time frame are you referring to? If it's when he was defining function1, the function wasn't called so it's contents weren't printed.

  • @vikaspal2799
    @vikaspal2799 3 ปีที่แล้ว +9

    Those 200 dislikes are by people who face difficulty in the process of switching on a computer

  • @sultanmahamud7134
    @sultanmahamud7134 7 หลายเดือนก่อน +1

    You just helped me with something i was stucked for long