Understanding Modulo in Python

แชร์
ฝัง
  • เผยแพร่เมื่อ 13 ม.ค. 2025

ความคิดเห็น • 556

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

    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

  • @jthegreat2024
    @jthegreat2024 6 ปีที่แล้ว +24

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

  • @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 7 ปีที่แล้ว +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.

  • @angelinokon
    @angelinokon  11 ปีที่แล้ว +62

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

  • @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 6 ปีที่แล้ว

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

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

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

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

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

  • @peterchandran4029
    @peterchandran4029 7 ปีที่แล้ว +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  7 ปีที่แล้ว

      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 7 ปีที่แล้ว

      Happy to hear that.

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

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

  • @DillonHinson
    @DillonHinson 11 ปีที่แล้ว

    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!

    • @angelinokon
      @angelinokon  11 ปีที่แล้ว

      Yahooooooo! So glad. ;)

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

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

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

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

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

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

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

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

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

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

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

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

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

  • @amreason
    @amreason 8 ปีที่แล้ว +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.

  • @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 8 ปีที่แล้ว +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.

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

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

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

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

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

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

  • @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! 😎👍🏻

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

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

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

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

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

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

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

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

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

  • @tech-by5jy
    @tech-by5jy 5 ปีที่แล้ว

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

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

  • @karakamen
    @karakamen 7 ปีที่แล้ว

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

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

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

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

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

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

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

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

  • @zaixeno7119
    @zaixeno7119 9 ปีที่แล้ว

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

  • @rbevans
    @rbevans 11 ปีที่แล้ว

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  • @eeeeelliottttt
    @eeeeelliottttt 7 ปีที่แล้ว

    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

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

    Thanks from 2021, this visualization was a nice help

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

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

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

      This is cute!

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

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

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

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

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

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

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

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

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

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

  • @raptorix-animations
    @raptorix-animations 2 ปีที่แล้ว

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

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

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

  • @ManjotSingh-f6211
    @ManjotSingh-f6211 10 หลายเดือนก่อน

    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 🇮🇳

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

  • @marlonmapile
    @marlonmapile 11 ปีที่แล้ว

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

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

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

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

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

  • @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 3 ปีที่แล้ว +2

      could you give an example of the B method?

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

      @@M8cool Am also interested. Thanks. :)

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

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

    7 years later helping me! Thanks!

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

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

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

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

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

  • @stoolpigeon
    @stoolpigeon 12 ปีที่แล้ว

    This is a very impressive video - you really put a lot of work into it.
    One suggestion - if tiny url goes away at some point you have a link that no longer works, and is actually longer than just linking right to the code skulptor site.

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

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

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

  • @RickDeez90
    @RickDeez90 8 ปีที่แล้ว

    Really great explanation of this! Loved it! Was having a hard time till with Modulo till I found this.

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

    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?

  • @sunvalleyyt
    @sunvalleyyt 8 ปีที่แล้ว

    Thank you so very much. Your way of explaining this operation is simple and logical. I now understand the purpose for this in Python. Have a nice day. :)

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

    Very good explanation, just learning C and I was stuck on one lesson until now! Thank You! best of luck in future endeavors

  • @JaydenPTV
    @JaydenPTV 10 ปีที่แล้ว

    Thanks for this Angel its been a great help.
    I'm doing the same course now.
    I am getting the tie and two wins but not the other two.
    Hopefully now I've watched this I'll sort it.
    Thank you again you are an angel xx

  • @netflixceo4925
    @netflixceo4925 7 ปีที่แล้ว

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

  • @700ysf
    @700ysf 3 ปีที่แล้ว

    9 years later and still helping

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

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

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

    For those of you who r reading this, you have a bright future ahead of u 👍 Have A Great Day! Cheers 🥂

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

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

  • @MuhammadImran-yq1qn
    @MuhammadImran-yq1qn 9 ปีที่แล้ว

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

  • @takes.you.likeee
    @takes.you.likeee 3 ปีที่แล้ว

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

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

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

    Amazing! Your illustration is perfect!

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

    2022 and this explanation still works. Thanks

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

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