Understanding Modulo in Python

Поделиться
HTML-код
  • Опубликовано: 24 окт 2024

Комментарии • 557

  • @hafidzrazman5365
    @hafidzrazman5365 7 лет назад +155

    2 hour lecture explained in 7min.. thanks alot.. you saved my life

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

    I went down a rabbit hole watching explanations and reading articles on how modulo works, but it still wasn't making sense when I threw random numbers in Python to try understanding it. Your video was what finally got it to click and allowed me to go back and make sense of the seemingly random results I got. I may now always remember it as the apples and net, thanks

  • @angelinokon
    @angelinokon  10 лет назад +186

    Hey I'm glad you guys are finding this helpful. Happy programming!

    • @frozen_tortus
      @frozen_tortus 9 лет назад +3

      +Angel Inokon Thank you Angel from the bottom of my hart, you just made me realize something i had a problem for quite some time now.

    • @angelinokon
      @angelinokon  9 лет назад +4

      +crashxxx Thankyou that warms my heart.

    • @thenonweaboo7852
      @thenonweaboo7852 8 лет назад +2

      thank you so much for the help you really are amazing at teaching

    • @geennaam9744
      @geennaam9744 6 лет назад +1

      Angel Inokon thanks I learn JavaScript

    • @bshirah
      @bshirah 6 лет назад

      Angel Inokon "Change the line that calculates x so the box is 250px wide, but the 250 is calculated using two numbers and the remainder (modulo) operator." Is the answer 500 % 2 even if the remainder is 0? Thanks, Angel.

  • @jojothegreat2130
    @jojothegreat2130 6 лет назад +24

    Girl! Four years later and this is still useful. God bless you Angel!

  • @JR-tt5oo
    @JR-tt5oo 9 лет назад +75

    Wow thanks, this was so easy to understand. No one has ever explained it like this, everyone always says just do division but for really large equations it doesnt make sense to me. But since you explained it this way, i can do the exact opposite, and get much faster than writing out long division :D

    • @angelinokon
      @angelinokon  9 лет назад +1

      +Joseph Richardson Bam! That is great to hear

    • @DLewis-pn8yo
      @DLewis-pn8yo 5 лет назад

      So do you then just rely on basic addition and subtraction?

  • @angelinokon
    @angelinokon  10 лет назад +61

    Thanks Walter. You aren't dumb. Smart people reach out for help. Thanks for reaching out.

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

    Hour and a half off searching RUclips and you were the one to give me that aha moment… thank you 🙏🏾

  • @agermoune
    @agermoune 3 года назад

    let the history mark this statement : I found this tut very useful during the Coronoa Virus Eara in late 2021 while taking Python Class. Thank you Angel for taking time 9 years ago to explain this topic

  • @elyonum
    @elyonum 4 года назад +1

    THANK. YOU. I swear, I was getting so mad at this because I couldn't visualize it, I literally just wanted someone to explain it to me like I'm a 5 year old learning how to sum up for the first time, and I FINALLY see it now. Thank you so much, your name is true to life, you're the real angel here!!

  • @kirillmiroshkhin
    @kirillmiroshkhin 6 лет назад +1

    Angel, that was amazing that you brought out human example to the problem. Very intuitive. Already 5 years, but people like myself are still benefiting from this video!

  • @Quotient153
    @Quotient153 5 лет назад +1

    I've looked at several explanation videos for this concept but you're is the only one that explained in a way that truly made sense to me. Many thanks!

    • @angelinokon
      @angelinokon  5 лет назад

      Thanks for the feedback. It really is an encouragement.

  • @steamducky9131
    @steamducky9131 3 года назад

    THANK YOU SO MUCH! I have looked all over to find a solid definition and you where the answer. You just gave a thirty minute long lecture within the timespan of seven and a half minutes.

  • @aljonclemente814
    @aljonclemente814 3 года назад

    8 years later, you've helped me! You're a legend! Amazing analogy!

  • @meitsme.7835
    @meitsme.7835 3 года назад +1

    Good Lord Angel! After referring to so many notes, tutorials and books: FINALLY!!!! I bet you, if i get modulo for my exams I'll be chuckling remembering Joe and his Apples ;-()... Seriously, thank you Angel! You indeed are one! Stay safe!!!

    • @angelinokon
      @angelinokon  3 года назад +1

      Good luck on your exams!

    • @meitsme.7835
      @meitsme.7835 3 года назад

      @@angelinokon Thank you Angel!

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

    Wow I've watched countless videos trying to understand this concept. Finally I understand. Thanks!

  • @bopbopboppp9
    @bopbopboppp9 4 года назад

    Bloody hell. looked up countless lectures and you just summed it up in a few minutes

  • @peterchandran4029
    @peterchandran4029 6 лет назад +1

    Hey ! You know what...you just enlightened me !! I was just surfing to find one soul in this planet that could explain me the USE of mod in real time. You just nailed it. I think you have a good teacher in you. The way you explain is cool in a way that it makes the listener feel the concept is cool and simple as well. I wish you come up with few more stuffs to rest some souls in peace. Keep going !

    • @angelinokon
      @angelinokon  6 лет назад

      Wow, what a nice comment. Thank you for the reply. I just did this once for a class, but I'm enrolling in a coursera course to learn how to build online learning. Who knows maybe more will appear in the future. Joy!

    • @peterchandran4029
      @peterchandran4029 6 лет назад

      Happy to hear that.

  • @DillonHinson
    @DillonHinson 10 лет назад

    I spent hours on stackoverflow trying to figure out the modulo and was still stumped. The way you explained it in this video is the clearest explanation of % that exists in the entire world! Thanks!

  • @DanWhalen
    @DanWhalen 11 лет назад

    I'm taking this same class right now and i found this video by accident via google search. so here your answering the EXACT problem i was having!!! this whole "students can teach eachother" thing acutally might work. THANK YOU SO MUCH!!!

  • @Shreddyward
    @Shreddyward 3 года назад

    I was stuck completely lost trying to understand how this works...You're amazing thank you.

  • @philipmicalizzi2786
    @philipmicalizzi2786 9 лет назад +1

    The examples you showed us instantly helped me understand modulo. I am a beginner programmer and I really needed this. Thank you so much!

  • @Gage95
    @Gage95 3 года назад +2

    Hi there, just wanted to extend my gratitude for the simplicity and fun interactivity of this education video. I enjoyed watching this and found it SO much easier to understand Modulo Division. Thank you! 😎👍🏻

  • @rgm2754
    @rgm2754 3 года назад

    Finally I found the explanation of the case when the first number is lower than the second! THANK YOU!!!!

  • @amreason
    @amreason 7 лет назад +2

    Not only was this a great explanation but its awesome that you did this to help your classmates. (and everyone else on youtube.) Found it while doing the python code academy class wondering how modulo works.

  • @mickehog76
    @mickehog76 9 лет назад +3

    This is so far the best tutorial I have ever seen about modulo!

  • @evilexistsOFFICIAL
    @evilexistsOFFICIAL 5 лет назад +3

    I know this is many many years late, but thank you so much! I am learning python 3.x from python 2.7, and for some reason I need modulus to progress with my course. Again, thank you and you have a new subscriber ✌

    • @angelinokon
      @angelinokon  5 лет назад +2

      Oh that's really kind. I am glad you are enjoying it. I just love this almost daily encouragement I get from this older video. I wish I had more content to share with you on my channel not much more right now.

    • @evilexistsOFFICIAL
      @evilexistsOFFICIAL 5 лет назад +1

      @@angelinokon No problem, glad to be here 😊

  • @ThePhoenix1
    @ThePhoenix1 2 года назад +1

    Thank you for this great explanation. My class is huge and my professor tried his best to explain it but it was still hard to understand. The apple exercises made it very clear. I truly appreciate it, bless you for the help!

  • @rainaldyd
    @rainaldyd 2 года назад

    This video is still relevant even after almost 10 years! Thanks a bunch!

  • @profpf
    @profpf 11 лет назад

    This is very well done. Thanks for walking us through it. Some people don't need all the examples, and some do. You have offered a valuable resource for those of us who were having some trouble with modulo. As far as the negative numbers, there is another video which suggests thinking of a 12 hour clock, and converting military time to the 12 hour clock. Negative numbers are just the numbers to the left of 12. He explains it much better than I do!

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

    Hey girl thank you, 11 years later you helped me today! I hope you are where you wanted to be

  • @1992maura
    @1992maura 5 лет назад

    What I could figure out in my lecture for ages, I figured out in your apple example in 30 seconds! So helpful, thanks!

  • @natanaelmuniz9348
    @natanaelmuniz9348 7 лет назад +1

    I am new to python programming and wrestled with this concept for some time until I saw your video. Thanks for taking the time to make it.

  • @LawrenceTheGreat
    @LawrenceTheGreat 8 лет назад +7

    Thanks for the video! I had a really hard time wrapping my head around modulo, but now everything is really clear.

  • @raptorix-animations
    @raptorix-animations 2 года назад

    Congrats, you somehow explained this whole concept to a 6th grader CLEARLY👏🏻👏🏻👏🏻

  • @tech-by5jy
    @tech-by5jy 5 лет назад

    Who in the world could have possibly given this video a thumbs down great job love it...

  • @mrp10012
    @mrp10012 5 лет назад

    WOW! Hope you're a teacher, best video I could find and only one that allowed me to understand it 100%!

  • @Enigma-fk7mh
    @Enigma-fk7mh 2 года назад

    Thankyou, You are a life saver ❤️. I can't understand this concept through internet forums. You simplified it so much & very easy to understand.

  • @gthou18
    @gthou18 2 года назад

    You're the absolute best. Thanks for such a great explanation. I'm a visual learner, so this helped me immensely. 🙏

  • @gwhatswrongwithyou9323
    @gwhatswrongwithyou9323 2 года назад

    You have a gifted to explain complex things to be very easy. Not many people can do this.

  • @ubeinhip
    @ubeinhip 4 года назад +1

    That’s the type of Math explanation I needed my whole life!!!!! Thanks

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

    Man, I was trying to figure this out with a textbook. This made it so much easier! Thank you for the net and apple analogy!

  • @YouDoneStreams
    @YouDoneStreams 2 года назад

    thank you for this! I'm currently in a program learning python and I came across the operands and operators a while back but then came across a new situation including modulo division in which i needed a refresher on which really helped because I felt mentally stuck trying to understand some code.

  • @followjeff
    @followjeff 3 года назад

    Great explanation Angel! I was having a tough time understanding modulos until I found your video. Thanks!

  • @pablozapata6551
    @pablozapata6551 9 лет назад +2

    Angel, the angel from Heaven. Thank you so much! I have struggling with the modulo for a while now.

  • @chrisjackson2595
    @chrisjackson2595 8 лет назад +1

    you are an absolute angel for this. thank you, i was never taught this concept in school.

  • @zaixeno7119
    @zaixeno7119 9 лет назад

    Wow! what I thought was gonna take months to grasp, I got it down in 3 minutes. Thanks!

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

    actually incredible video, explained in a simple and concise way. You're a great teacher!

  • @mohammedraiyanjamal2821
    @mohammedraiyanjamal2821 7 лет назад

    Thanks a lot. Like everyone else, I came up here to understand how modulo works and your video made it clear.
    Keep up the good work.

  • @person81045
    @person81045 4 года назад

    Thank GOD i found this video. Watched 3 others and they made it worse. You're a great teacher. Those who understand the concept the best explained it in simpliest terms. Thank you!

  • @marlonmapile
    @marlonmapile 11 лет назад

    Wow! I was so frustrated with modulo until I came across your awesome video! Thanks!!

  • @VoodooCollectables
    @VoodooCollectables 4 года назад

    Just started python. Had no idea how or what this meant. Very helpful. Now have a basic understanding to get me started. Thanks

  • @rbevans
    @rbevans 10 лет назад

    Thank you for putting this video together. I confused myself before watching this video, and you straightened me out.

  • @ingvildbergersen1282
    @ingvildbergersen1282 6 лет назад

    Thank you! I tried to google modulo and I didn´t understand anything until I found this video. Nicely explained!

  • @renyongsun9102
    @renyongsun9102 3 года назад

    This apple example is brilliant, it really solved my confusion, much appreciated.

  • @anusha8093
    @anusha8093 3 года назад

    OOHH MY GOD...U CLEARED MY DOUBT...I HAVE BEEN SCROLLING RUclips FOR UNDERSTANDING THIS OPERATOR..BUT YOUR VIDEO IS THE BEST🌟♥️

  • @jacosaraiva1
    @jacosaraiva1 5 лет назад

    Thank you very much for the explanation. You were very didactic and left tangible content.
    Your explanation allowed me to understand mod with negative dividend
    I had already lost hours searching trough so many sites and channels and it was not logical the concept of the negative number module did not follow the logic of the arithmetic division.
    Your video was an eureka to me.
    I hope you continue to post content like this.
    Thankful.
    JS

  • @jollycolours
    @jollycolours 3 года назад

    You're such an angel for making this tutorial! Thank you so much!

  • @jedigrasshopper8098
    @jedigrasshopper8098 7 лет назад +2

    All morning I've been all over the net trying to figure this out and your video made sense of it in seven and a half minutes 😓

  • @nikolaisandbeck6951
    @nikolaisandbeck6951 5 лет назад

    Thank you very much! I am learning python at the moment, and i choose the book "Learn python 3 the hard way". The author often leaves it to the reader to find out what things is, by searching the internet, and I found this video :)

  • @eeeeelliottttt
    @eeeeelliottttt 6 лет назад

    I don't know why I was so confused that 1 % 3 = 1 but at the end when you were talking I felt like a 2 year old shouting answers at the TV thank you so much

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

    Oh my goodness you are a lifesaver for understanding this! Thank you Angel!

  • @uniworkhorse
    @uniworkhorse 4 года назад

    7 years later helping me! Thanks!

  • @karakamen
    @karakamen 7 лет назад

    I'm learning C# and this example explained the modulo concept crystal clear for me. Thank you!

  • @markarnett4900
    @markarnett4900 9 лет назад +1

    i'm only 2 minutes in and i can tell this is gold. thank you.

    • @angelinokon
      @angelinokon  9 лет назад +3

      +ThisIS RIDICULOUS Your comment made me laugh. I actually rewatched the video to get to the 2 minute mark. Love it.

  • @nateburkart8947
    @nateburkart8947 4 года назад

    I am a visual learner, so the graphic with the apples really helped! Thank you so much

  • @n_1913
    @n_1913 3 года назад

    I can't express how thankful I am I'm learning c but the concept is the same, finally I understand.

  • @ShmeegleSon
    @ShmeegleSon 3 года назад +6

    print("this was awesome thank you!, you saved me!")

    • @MuslimConvertGirl
      @MuslimConvertGirl 3 года назад

      This is cute!

    • @n_1913
      @n_1913 3 года назад

      there is an error you forgot ; at then end :(

  • @Sovaccent
    @Sovaccent 4 года назад

    Just started out learning Python, and this video made modulo finally sink in to my big dumb brain! Thanks!

  • @zippityzoop2576
    @zippityzoop2576 3 года назад +1

    Thanks from 2021, this visualization was a nice help

  • @xound101
    @xound101 4 года назад +1

    hey love i always said all teachers are not teachers in 100 teacher one teacher know how to teach and you are great teacher i am really dumb in maths but still helpfull :) i know its my fault i know when i saw this again i ll b done with this one thanks again you deserve smile :)

  • @gooddev506
    @gooddev506 5 лет назад +1

    Thank you. I was struggling to understand this concept. You made it so easy. you should seriously teach programming.

  • @ManjotSingh-f6211
    @ManjotSingh-f6211 7 месяцев назад

    It's very easy to understand I am very thankfull to you to teaching in such a easy way now I can give my exam tommorow from India 🇮🇳

  • @tinashemakina7196
    @tinashemakina7196 4 года назад

    This video is AMAZING! I wish I found this video during summer classes 😭

  • @beefwater
    @beefwater 6 лет назад

    Fantastic tutorial. Helped me so much. Your hard work made a difference.

  • @NuevoVR
    @NuevoVR 7 лет назад

    on all the forums they make it sound like only einstein can understand it
    then i watch a video on youtube where a kind lady explains it using pictures of apples like im a kid and i understand it completely
    thank you so much, liked and subbed. you really helped me out big time

  • @deborahboldin6143
    @deborahboldin6143 2 года назад

    I was just stressing over this because I couldn’t understand how to do this from my homework and now I finished it all thanks to you🥺

  • @aarontaylor711
    @aarontaylor711 5 лет назад

    Angel,
    Thank you for creating this video that, in simple terms, explains a problem that seemed complex and was hard for me to grasp. I am taking a course online and was having trouble finding resources that explained the concept of modulo and felt like I was on a island by myself.

  • @duxmyman555
    @duxmyman555 5 лет назад

    Thank you so much for this. The way you explain things makes it so easy to understand. You need to create a math channel.

  • @michaelgilbert6535
    @michaelgilbert6535 11 лет назад

    I looked all over for an explanation for why, for example, 10%20 equals 10. It made no sense to me! Your video is the only one I could find that explained it. Thank you!
    To take it a step further, I think I know why mathematically it does this. Apparently, (correct me if I'm wrong) the formula that Python uses for solving modulo is:
    [a - ((a/n)*n]
    This makes sense only because it looks like Python is doing integer division with a/n. i.e. 10/20 is 0 in integer division. So [10 - (0)*20] = 10

  • @mememomdotcom
    @mememomdotcom 2 года назад

    As a dumb person with A.D.D. trying really hard to learn coding so I can support my kids with a worthwhile career, thank you for this.

  • @kingfisherblues57
    @kingfisherblues57 10 лет назад +1

    Angel, thanks for doing this, it is great! I do understand modulo much better now. Still having some trouble applying it to the rock, paper, scissors, lizard, Spock problem but I am MUCH closer thanks to you!

  • @TheRealSandeepBadloe
    @TheRealSandeepBadloe 2 года назад

    Your explanation and examples were just what I needed to understand modulo! Thank you so much!

  • @SharonDKenny
    @SharonDKenny 9 лет назад +3

    WOW! Now I understand why 2 % 10 is 2. Thank you, Angel.

  • @brotherhood19991
    @brotherhood19991 5 лет назад

    Angel, you are truly an angel, thank you so much for explaining this concept, you are the best.

  • @Plepple
    @Plepple 3 года назад

    Thanks for the intuitive lesson Angel! One quick note on how this is sometimes used in coding:
    A) to find out if number is even or odd
    B) to do something every nth iteration of a loop

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

      could you give an example of the B method?

    • @seventeen9718
      @seventeen9718 2 года назад

      @@M8cool Am also interested. Thanks. :)

  • @cyclone538
    @cyclone538 7 лет назад +3

    Thank you so much I was trying to understand this, created my program was just not understanding why i was using % lol.

  • @umerhammaz
    @umerhammaz 2 года назад

    TYSM! 10 YEARS AGO BUT STILL WORKS!

  • @netflixceo4925
    @netflixceo4925 6 лет назад

    Thank you so much. Have to learn excel VBA coding in a civil engineering class (no idea why) and this just helped so much.

  • @MuslimConvertGirl
    @MuslimConvertGirl 3 года назад

    This is soooo helpful. I'm doing the Code Academy pathway for python. My only question is - why would this type of function be used in the real world?

  • @Aya2025.
    @Aya2025. 3 года назад

    Thank you soooo much you saved my day. I was strugling with understanding this operator

  • @sarinaguillen6895
    @sarinaguillen6895 6 лет назад

    Thank you very much, it was really helpful to me.
    Greetings from Bolivia South America

  • @Alexandru-OM
    @Alexandru-OM 6 лет назад +1

    Thank you Angel for your time and work, this made me remember modulo. Have a nice day :)

  • @fakfatkids1812
    @fakfatkids1812 2 года назад

    I love elementary explanations. This is the only way i finally understand modulo 😂 thank you!

  • @BearLeeHangin
    @BearLeeHangin 2 года назад

    This is great! Thank you for this video. I know it’s almost 10 yrs old but it’s good stuff!

  • @MuhammadImran-yq1qn
    @MuhammadImran-yq1qn 8 лет назад

    Really great. I find many tutorial but i have understand from your tutorial Thanks dear.

  • @davurphy
    @davurphy 10 лет назад

    Thank you for making this tutorial. It helped solidify the concept for me.

  • @javierpacheco4566
    @javierpacheco4566 5 лет назад

    Amazing! Your illustration is perfect!

  • @welcometomymind6111
    @welcometomymind6111 2 года назад

    Thank you for this, could not find any explanations that made sense. I will always think of a catcher taking away apples now. :)

  • @FireArmPlays
    @FireArmPlays 3 года назад

    2021 and it's still useful, thank you ma'am.

  • @isaacsolivan1143
    @isaacsolivan1143 2 года назад

    2022 and this explanation still works. Thanks