Enumerate Will Save You From THIS!

Поділитися
Вставка
  • Опубліковано 15 бер 2022
  • Having a counter showing where you are in a loop or other iterable is a very useful thing, and there is a very easy option that I've certainly done before as well as seeing a lot of beginners take. But it's not the right way. We have enumerate() in Python that will give you the index and the value of the iterable we are looping through. It's very useful and I'd recommend you start to add it into your code now.
    Support Me:
    Patreon: / johnwatsonrooney
    Amazon UK: amzn.to/2OYuMwo
    Hosting: Digital Ocean: m.do.co/c/c7c90f161ff6
    Gear Used: jhnwr.com/gear/ (NEW)
    -------------------------------------
    Disclaimer: These are affiliate links and as an Amazon Associate I earn from qualifying purchases
    -------------------------------------
  • Наука та технологія

КОМЕНТАРІ • 47

  • @abdelrhmandameen2215
    @abdelrhmandameen2215 2 роки тому +16

    I can’t enumerate all great videos and lessons you have put on UA-cam.

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

    Love these bit size tips & tricks, keep it up!

  • @stifferdoroskevich1809
    @stifferdoroskevich1809 2 роки тому +3

    10/10 Content
    10/10 Interpretation
    .
    -
    9/10 Outfit (Missed a Coffe Mug/reading glasses for the "senior" character) :D XD

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

    Great to see the channel growing 👍
    Well deserved

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

    Solid tip! Thanks for sharing

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

    Thank you for your simple explanation.

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

    the best python teacher on earth thaaanks sir

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

    Entertaining and educational: great video! 😁
    Thank you John & John.

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

      Thanks! That’s exactly what I was going for

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

      @@JohnWatsonRooney Also the education-entertainment balance is great: too much comedy throughout the video would distract from the educational content.
      The way you did this was perfect!
      The only thing I can think of to make this video better would be to extend the suggested video time at the end for 1 or 2 seconds, so there is a bit more time to click it.
      It went to the ad before I could click it after realising what the suggested video was about.

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

    Thank you John!

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

    Really handy tip thanks

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

    Amazing John as usually , thank you for this vedeo

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

    One of my favourite tricks!

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

    THat was wonderfull !!!

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

    Amazing ! It was really helpful for a beginner like me. But I am curious about the way to view the source code of enumerate and other built-in functions.

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

    Nice way to segway in to just programming

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

    Great video - but the acting was outstanding! 🎥

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

    Brilliant video m8

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

    Thanks

  • @tanuj05
    @tanuj05 6 місяців тому

    Nice vid

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

    LOVE enumerate!

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

    Keep up the great work. Btw what PyCharm theme are you using in this video?

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

      Ahh good question I’ve been messing around with my themes recently and I can’t remember! I’ll find it and post back

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

      @@JohnWatsonRooney Did you forget ;)

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

      @@alan_tucker 100% sorry!! It's GruvBox Dark Soft (or Medium they are similar)

    • @alan_tucker
      @alan_tucker 2 роки тому

      @@JohnWatsonRooney Awesome thanks :)

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

    thanks :)

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

    How old is your watch?! I had one of those when I was just a kid... and now I'm 32...

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

    You don't get the index, you get simply counter and that by default equal index.

  • @mabdurrafeyahmed9256
    @mabdurrafeyahmed9256 2 роки тому

    Should have used map.

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

    always a bit too fast in pace but great content

    • @JohnWatsonRooney
      @JohnWatsonRooney  2 роки тому

      Thanks, it’s quite hard to judge the pacing, too slow and people leave too fast it’s not explained well enough

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

      @@JohnWatsonRooney I understand but may I suggest that the pace should be directly proportional to the complexity of the topic? Enumerate is pretty simple to grasp so since it’s targeted to new programmers, it should be explained slower. I’m being picky as pace is user controlled anyway. I would like to emphasize that I really enjoy your contributions!

    • @JohnWatsonRooney
      @JohnWatsonRooney  2 роки тому

      @@Master_of_Chess_Shorts Absolutely that's a very good point, match the pace to the target level

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

    sorry but you acc get a sub my friend

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

    Thanks