Be a Python Pro with Enumerate

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

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

  • @jan0195
    @jan0195 Год назад +3272

    When you read the documentation once:

    • @robmulla
      @robmulla  Год назад +261

      Who reads documentation? Kidding! You’re the real pro.

    • @samueljehanno
      @samueljehanno Год назад +6

      😯

    • @MemesterTheMaster
      @MemesterTheMaster Год назад +34

      I don't understand how people have difficulties understanding the documentation....
      As long as you think, you are doing fine
      But read the thing.

    • @GetOffMyPhoneGoogle
      @GetOffMyPhoneGoogle Год назад +18

      TempleOS is still superior.

    • @originalbinaryhustler3876
      @originalbinaryhustler3876 Год назад +3

      thanks am going to read the docs

  • @jackmillen
    @jackmillen Год назад +2997

    Ngl, calling people a noob is kinda a noob thing to do

    • @antonevstigneev846
      @antonevstigneev846 Год назад +114

      yep, because he is also a noob who doesn’t even use List comprehension

    • @the_w0nderful43
      @the_w0nderful43 Год назад +3

      I put dislike on both of your comments

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

      Noob noob noob

    • @jackmillen
      @jackmillen Год назад +46

      @@the_w0nderful43 Okay. Have a nice day!

    • @mettwasser
      @mettwasser Год назад +4

      ​@@antonevstigneev846 why in ther world would he use a list comp here..? xd

  • @5cover
    @5cover Год назад +1025

    Frankly, as long as you write clean, readable code, you're a pro to me, regardless of your knowledge of python's forensics. ❤️

    • @robmulla
      @robmulla  Год назад +61

      That’s a fair take.

    • @wonderfulworldofmarkets9033
      @wonderfulworldofmarkets9033 Год назад +15

      So I went down a rabbit hole with this one. At first I thought that enumerate is worse since in assembly, its a jmp and then iterating pointer and assigning vs just iterating and assigning. Turns out in newer version of Python they have made enumerate faster than reading and assigning!

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

      yeah clean code makes a huge difference

    • @Haja024
      @Haja024 7 месяцев назад

      ​@@geekzombie8795 Some people enjoy gaining knowledge, Brad.

  • @dallin5861
    @dallin5861 Год назад +391

    The other two ways are perfectly acceptable in other languages and may even be easier to read so I have no issue with them.

    • @robmulla
      @robmulla  Год назад +29

      Ok, you win! But now people know they all exist :D

    • @derickd6150
      @derickd6150 Год назад +4

      Yeah honestly this is why I hate python 😂

    • @juliodonofreo
      @juliodonofreo Год назад +10

      Other languages actually have a numeric for loop, and not the odd range() thing. Don't get me wrong, python's for is good and works for everything, but this range() thing is weird

    • @specter538
      @specter538 9 месяцев назад +10

      ​@@juliodonofreo I too was really frustrated with python's for loop in the beginning. But there's a way around it.
      For example writing something like,
      for i in range(1,10,2):
      print(i)
      Is the same as writing,
      for(int i=1;i

    • @tegathemenace
      @tegathemenace 7 месяцев назад +2

      ​@@specter538 in their heads it's shorter😂. Anything to stay unique I guess

  • @tophat593
    @tophat593 Год назад +192

    I've been coding python for more decades than I care to admit and if someone used the first two I wouldn't think they're "noobs", it's perfectly fine. Or conversely, that using the enumerate function is anything to show off about.
    The fact you think it's advanced says more about you than anything else.

    • @robmulla
      @robmulla  Год назад +61

      Hey Tophat! I can appreciate your reaction. This short is just intended to be funny. I intentionally went over the top with the "noob" stuff just to make it more interesting in hopes that people would learn something new. Sorry if it came across too harsh.

    • @tophat593
      @tophat593 Год назад +42

      @@robmulla Oh, now I feel mean! I obviously got the wrong end of the stick, apologies.
      Don't worry in the slightest, enumerate is a nice solid thing to teach learners for sure, very handy. If I'm honest, it's what I use by default.

    • @jacckkaboii3528
      @jacckkaboii3528 Год назад +60

      @@tophat593 most humble argument in the youtube comment section to date.

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

      😊

    • @lukesavefrogs
      @lukesavefrogs Год назад +4

      ​@@jacckkaboii3528 true

  • @unhhgcrxexhjvuvujchcrzwzwz7956
    @unhhgcrxexhjvuvujchcrzwzwz7956 11 месяцев назад +7

    “Sorry the counter method is just because I’m so used to writing assembly in embedded systems, take that noob”

  • @llambduh
    @llambduh Год назад +20

    If your only goal was to take a list, give it indexes, and print it you could just do this:
    print(list(enumerate(todo_list)))
    You can lose the loop, it entails unnecessary overhead for loop control. You had unnecessary string manipulation with the call to the .title() which also cost time. The print function you use in the loop introduces overhead because of the underlying system calls it makes. Making multiple prints can be slower than a single print, especially if there's a lot of data to print.

    • @pfizerpflanze
      @pfizerpflanze 3 месяца назад

      The output should become
      [(0, item1),..., (3, item4)], and even if you unpack the list with print(*list(enumerate(todo_list), sep='
      ') the result won't be accomplished, because brackets will still be present and items won't be titled.
      Nice try anyway, I thought of a oneliner as well, without success

    • @fastasfuuckboi
      @fastasfuuckboi 3 месяца назад +1

      @@pfizerpflanze "If your only goal was to take a list, give it indexes, and print it".
      The one liner does exactly that, they said nothing about specific formatting for output.
      "Nice try anyway"

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

    Calling people noob for their negligence to your own desire is the real noob person

  • @nirbhay_raghav
    @nirbhay_raghav 2 года назад +8

    I see you have spiced thing up come 2023. It is fun to watch. Love to see you work hard everyday with all the shorts and streams. I see that the freq of streams have increased. This motivates me to work harder! Thank you GM!!

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

      Thanks for watching. I tried to take a different “tone” in this video. I thought it was funny. Glad it motivates you! Keep working hard!

  • @Alee_Calee
    @Alee_Calee 7 месяцев назад +2

    This was really helpful for my 5th grade python on-paper test, thx!

  • @blaze_eagle
    @blaze_eagle Год назад +59

    But why is it so much better?
    Does it help improve Data management? Is it faster? does it have any substantial advantege against just going through an Loop with the iterable Object range?

    • @moonlightaria968
      @moonlightaria968 Год назад +10

      performance wise there doesn't seem to be much different, main advantages is its more explicit and shorter line wise, but these tend to minor concerns, it also has the advantage for working on iterables without indexes when that case comes up

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

      It’s easier to work with, let’s say you want to access the index or use it to relate to some data inside a list or a dictionary, is easier to access it with enumerate.

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

      It's not better it likely works like the range does but looks "cleaner "

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

      yes. You have both the index and the iterated item. You don't have to worry about how to access the item with an index.
      It might also be faster too. Probably not though.

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

      @@aocs13 you should not use indexes to access dictionary items. You should use the key. If the key is the index you should use a list.

  • @AyatExplorer
    @AyatExplorer 7 месяцев назад +2

    POV: U've learned a knew thing & excited 2 teach ppl abt it...

  • @MrCaturday
    @MrCaturday Год назад +13

    Enumerate looked so complicated to me at first when I was a total beginner. Now I kinda feel stupid, it's super easy. But feeling stupid is part of being a programmer I guess.

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

      No, you just stupid, I guess.
      Kidding!

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

      Every programmer is stupid in my opinion, after coding for hours we just lose simple concentration

  • @justinsamuelson4500
    @justinsamuelson4500 3 месяца назад

    Self esteem boost! I use this all the time but felt like and still feel like a total noob, this made me feel better

  • @TheVergile
    @TheVergile Год назад +46

    the real noob thing would be to not mention why this would be better and why people should care

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

      You’re right!

    • @bobby9192
      @bobby9192 Год назад +11

      @@robmulla noob

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

      I'm a noob both in English and python but. Usually builtin functions in python are faster since they use lower level language.
      Thus when you use enumerate counters are being assigned in C. If you move this assignment into a python script by using variable inside the loop. You make it a tiny bit slower that cans tack for bigger lists.
      Same goes for len, you have to access index of the variable every time instead just getting it from the builtin function.
      And if you just need index and not content itself, you can always use throwaway variable "_"

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

      Should i go for c or python i agree im a total noob but suggest me

    • @lpalaguachi2
      @lpalaguachi2 10 месяцев назад

      ​@@Fallofduty56 I've been coding for only like a month, but in my opinion you should learn Python before learning C

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

    Using basics doesn't make you noob.

  • @SlyceDFI
    @SlyceDFI 9 месяцев назад +15

    meanwhile c/c++, c#, java, js and many others:
    "iterating over a list? nah havent heard of it"

    • @koam_
      @koam_ 8 месяцев назад +4

      bro has never heard of a foreach loop 💀

    • @gandalfthegrey2777
      @gandalfthegrey2777 6 месяцев назад

      Bro

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

    from double noob, to python pro just like that, oh boy what a day.

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

      It’s almost too easy…

  • @Adomas_B
    @Adomas_B Год назад +84

    C language family devs: look at what they need to do to mimic a fraction of out power!

    • @robmulla
      @robmulla  Год назад +6

      We only wish we in the python community had your power! 😂 luckily all the good python packages use C backend code.

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

      As a C guy, I much prefer the "for .. in" construct. _Most_ use cases could just use the "for .. in" construct. Is it too much to ask for both the "for ( ; ; ) { }" _and_ the "for .. in" construct in the same language? That's what I'd like.

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

      ​@@mage3690macro / ifdef

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

    Crazy co-incidence. I rarely code but had to do a few things and used this method noting it was different from the "counter" methods. Pretty cool.

  • @user-bg1xh3yl5o
    @user-bg1xh3yl5o Год назад +45

    as a c++ user, i find it hard to believe this isn't common knowledge lmao

    • @818de60
      @818de60 Год назад +2

      It is

    • @smieszkipikczers1568
      @smieszkipikczers1568 Год назад +3

      It is common AF

    • @818de60
      @818de60 Год назад +1

      @@smieszkipikczers1568 ur mom common af

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

      hah. yea I guess we all have something to learn.

  • @bucketzzz.
    @bucketzzz. Год назад +1

    Hey man thanks for this! Helps make it a whole lot easier.

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

      Thanks for the positive feedback. A lot of people seemed to miss the joke. The point was to teach something new.

  • @eugenex8892
    @eugenex8892 Год назад +601

    Don't be a noob, don't code in python :)

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

    as a machine learning engineer I see this as an absolute win, I think

  • @fingerman4086
    @fingerman4086 Год назад +56

    Enumerate is awesome but sometimes you really just need an index, and so range(len(Object)) works just fine

    • @msschubi
      @msschubi Год назад +4

      But you get the index with enumerate? or did i get this wrong?

    • @robmulla
      @robmulla  Год назад +3

      Good point. There are many ways, true. Whatever suits your fancy!

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

      @@msschubii guess if you are only using the index then enumerate is a waste of time because you only need the index, not the actual value

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

      for i in enumerate(list):
      ........

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

      ​@@Pilosofiano, that doesn't work iirc

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

    I was literally writing code for this a minute ago, I go on shorts and I see my solution!

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

      haha. I love that! But it's also a little bit scary.

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

      I feel like he's stalking you

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

    Then I am "Pro Noob", because I use any of these methods at will 😂😂😂

  • @devanshjaiswal9502
    @devanshjaiswal9502 7 месяцев назад

    I am that double noob. I'm subscribing right away!

  • @godbernaz
    @godbernaz Год назад +3

    Im just starting and I had to do something similar today for my work and this appears, thanks!

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

    "No, don't do this this way, we already have a built in function for ya"

  • @christophercarillo4784
    @christophercarillo4784 Год назад +13

    Me watching the video:
    Doesn't enumerate come from itertools tho?
    Me after a quick Google search:
    Oh nice, it's a built-in function

    • @robmulla
      @robmulla  Год назад +4

      Hey! You learned something. Nice.

  • @temie933
    @temie933 8 месяцев назад +2

    Dead giveaway you’re a noob: using inbuilt functions for everything

  • @JoeBob189
    @JoeBob189 8 месяцев назад +17

    Really? Youre going to shame people for using the "for i in range"?
    It is a core concept in Python, and does exactly what it needs to. Can you give a technical reason for *why* you shouldnt use "for i in range"?

    • @skylo706
      @skylo706 7 месяцев назад +3

      There is none. He shows a solution to a different problem when you have a list of objects you want to iterate and do something with. His use case/example has nothing to do with it and is just slower

    • @michaelbarker6460
      @michaelbarker6460 7 месяцев назад +2

      NOOB!!
      Jk I don't even code. I don't know why I'm here.

    • @andrewtate8792
      @andrewtate8792 7 месяцев назад

      😂😂​@@michaelbarker6460

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

      ​@@skylo706nah what he did is exactly what you do with i in range
      Entire video is just satire

    • @RoboArc
      @RoboArc 3 месяца назад

      They are all the same speed basically. No advantage

  • @jangrygiel9934
    @jangrygiel9934 6 месяцев назад

    You could write it in just one line and also with the optimalization included.
    items = [5,3,2,5]
    [print(counter + 1, el) for counter, el in enumerate(items)]

  • @MercuryShore
    @MercuryShore Год назад +4

    Yeah let me just call a function for every tiny thing in my programing life so I don't get called a noob in a RUclips short.

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

      Now you’re getting the idea!

    • @vercot7000
      @vercot7000 5 месяцев назад

      enumerate takes about 3 seconds to type out, so yes

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

      well programmer = noob

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

    I believe there are more than one way to achieve a result. You go with the one you're comfortable with.

  • @GottZ
    @GottZ Год назад +5

    fun fact about enumerate.. it's essentially a counter so it's equal to the double noob solution.

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

    Syntactic sugar is nice, but honestly, a simple loop counter, either manually or by means of the "for"-statement, is verbose and does not add a ton of clutter or overhead. If you actually need the counter and especially if you do maths with is, I feel a dedicated variable serves you much better.

  • @adrisongomez6482
    @adrisongomez6482 Год назад +4

    I found it like 3 or 2 weeks ago by mistake and it’s really nice function

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

    This was literally the first thing I learnt when doing my python course.

  • @Viii498
    @Viii498 Год назад +6

    Oh, I didn’t know Python was a real programming language 😂

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

      Yea. That’s a different issue altogether 😊

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

      It is not, it is just a wrapper. All heavy libraries are written in C anyway.

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

      @@koleso1v blablabla

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

    I’m a senior python developer and at least in the finance industry there hasn’t even been a single situation where I would ever need to do something like this (btw I when I said finance I didn’t mean I work on THE actual finance systems but rather I work on a company within that industry as some sort of devops without the ops… but still doing CICD).
    Good to know this exists but I doubt not knowing this or doing one of the “noob” approaches will even get you fired in the real world

  • @anubhav9476
    @anubhav9476 Год назад +12

    python tips with davie504 style xD

  • @hypatia-du-bois-marie
    @hypatia-du-bois-marie Год назад

    Me, the Haskell cultist: zip the entire stream of integers to the list, lift that function postcomposed with putStrLn, and then sequence/commutate the Traversable list with the Monad IO.

  • @CodingCorvus
    @CodingCorvus Год назад +12

    My code might not be efficient, looks like a three year old coded it.
    But you know what it works for what I want with it. And that in the end is what matters

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

      I like this take. You do you! Video was meant to be funny and teach something new but I 100% agree with you.

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

      I agree 100%

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

    Counters can be especially useful because they can be used to increment several variables at once.

  • @Michael-ty2uo
    @Michael-ty2uo Год назад +12

    Bro every type of these videos explaining how to do something a "better" way in code gets spammed with comments calling the creator of the video a clown 😭

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

      Is that bad or good? I know it's good for engagement....

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

      I'l give you example. I had to hire two new junior devs as our team grew in past month or so. We had over 300 applicants and few of them had coding channels like these. Every single one was presenting themselves like seniors with 15 years of experience and weren't even able to write proper djisktra.
      You're better watching people like DavesGarage instead of pseudo-helpful channels like this.

    • @Michael-ty2uo
      @Michael-ty2uo Год назад

      @@robmulla it’s Bad if you have a community calling you a clown it’s good for short term engagement but horrible for long term engagement.

  • @Aliarh-TRC
    @Aliarh-TRC 8 месяцев назад

    Well that is a built in function that can do that... but it is VERY slow in big lists, and can dramatically slow a program down with no clear sign of what is slowing things down

  • @hidden_leafy
    @hidden_leafy Год назад +3

    I thought you were going to use the index lol
    for things in mylist:
    print(list.index(things), ',' ,things )

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

    From what I have read on the docs it seems that enumerate creates a entirely new list
    I feel like it would require less memory / resources at some level to just do indexing and access a specific element from the list
    Like you are going through a list and you break out of it then you would have not needed to access the rest of the items
    Also on a personal note, saying someone is a nood is kinda discouraging people from experimenting with code

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

      No, enumerate returns an enumerate object which is an Iterator, it does not create a new list nor it requires any significant memory compared to the size of list(basically its almost free operation, memory wise).

  • @skylo706
    @skylo706 8 месяцев назад +3

    When noobs tell noobs how to code:

  • @2mellow35
    @2mellow35 Год назад

    My professor would flip if i used that.

  • @gaurav_r13
    @gaurav_r13 Год назад +4

    Use comprehension with enumerate :: double pro 😂😂

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

      So true

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

      But then you would have an array of tuples.

  • @kwith
    @kwith 5 месяцев назад

    Been coding for a couple weeks now. With the amount of stuff I keep finding I'm gonna be a noob for YEARS lol

  • @prashlovessamosa
    @prashlovessamosa 2 года назад +15

    I am certified noob.

    • @robmulla
      @robmulla  2 года назад +9

      Plot twist: I’m actually a triple noob….
      I use all three sometimes. Video is meant to be in a joking manner. Hopefully it comes across that way 😂

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

    There are so many ways to code even a single thing, but real pro is coding like a noob so that real noobs or whoever can understand code so easily 😊

  • @Kumar-oe9jm
    @Kumar-oe9jm 2 года назад +5

    Are we just gg to ignore the "eat brains" 😳 😳💀💀

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

    Well... Under the hood it's basically doing the same thing. I suppose the code is more pythonic, but it only really improves readability if you're familiar with enumerate. Still a neat tip.

  • @pastori2672
    @pastori2672 8 месяцев назад +4

    **it doesnt say shit**

  • @officialwhitecat
    @officialwhitecat 5 месяцев назад

    What editor are you using? Seems cool and interesting

  • @AlphaChinou
    @AlphaChinou Год назад +5

    Python is dope

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

      That we can agree on.

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

    creating a range of length whatever does seem a little silly, but the counter solution is just as good as enumerate tbh.
    Also I wouldn't necessarily consider any approach a noob. if you're just iterating over a short list, its not a big deal how you manage it. I'll worry about code when it counts lol

  • @andrewhabroad
    @andrewhabroad Год назад +3

    Now build it in c++

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

    I am a noob started learning python just for fun recently. Hope I can become a pro one day.

  • @Rajarikamvamshi
    @Rajarikamvamshi Год назад +3

    If you think, doing this make you expert then you are certified noob!

  • @damonmlinaric9254
    @damonmlinaric9254 6 месяцев назад

    You know what actually makes me a certified noob is that I don't understand a goddamn thing you just said yet lol

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

    Im a week into my Python self learning - 90% of what he said was gibberish
    I’ll eventually start it all 😂

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

    I can’t even do the first and second yet, so I’m super noob !!! But now I know Enumerate !!

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

    Enumerate is literally covered in the 3rd or 4th lecture in most Python for Humanities courses (I've taken one as a linguistics student back in the days, but I have seen the detailed curriculum for a bunch of others). Those courses teach you to make primitive scripts suitable for small data processing and nothing else. Knowledge of enumeration does not "un-noob" you anyhow 😂

  • @minecraftcoder.
    @minecraftcoder. Год назад

    Something like that really depends. There is not right way to do something so modular like a loop. It all depends on your needs. If you need to repeat iterations, an approach like this would be the noob thing to do.

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

    Learned this pretty early on, quite often though I wouldn’t care about the index, like your first print example, so it would have been cleaner and more straightforward to do it the “noob” way

  • @zxwar1111
    @zxwar1111 3 месяца назад

    Me just storing everything in a separate file and asking the main program to call that file

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

    Glad there are multiple ways to do it.

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

    N00b : Doing things the hard way!
    Pro : just use built-in functions

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

    I'm really used to writing in c and c++, I didn't even knew of the enumerate function! Looks pretty handy

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

      Glad you learned something!

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

    Me: I am not noob 😃
    He: DOUBLE NOOB!!!

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

    Loved the applied noob concept

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

      As a noob myself I know a thing or two about it :D

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

    when the teacher said no library 💀

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

    You can pass the start argument to define the index

  • @matteoburri-m4h
    @matteoburri-m4h 6 месяцев назад

    Thanks! U remember me about enumerate function❤

  • @jamil1985
    @jamil1985 8 месяцев назад +1

    I am a noob. Still learning.

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

    You learn enumerate in your first programming course within the first 2 weeks. You can tell a real noob when they use enumerate for no reason and don't even use the indexes in their loop.

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

      It’s a joke bruh 😂

  • @foremost6233
    @foremost6233 10 месяцев назад

    I am a beginner and a noob in the python language. I will be a pro pythonista someday.

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

    "python is the JavaScript of programming languages"

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

      lol. What?

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

      wata roast
      edit: I agree with Sherlock, stop calling us noobs...

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

    As long as there isn't a difference in performance, I'll take easy to read code over pro code.

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

      You do have a point there.

  • @BobChess
    @BobChess 10 месяцев назад

    C programmer after watching this video(They just called noob):

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

    I like the way you did it

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

      Thanks. I was trying to be a little funny in this video. Did you like the way I did the code or the video?

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

      @@robmulla the video , it is funny and thanks for enumerate()

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

    I’m like 1 week into Python and I know about enumerate, I also know that for loops in Python are expensive af and a giveaway that you don’t give a shit about performance

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

    The funny thing is that in all the other languages I have used, the index variable is required in a for loop header

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

    I honestly hate python for loops so much, why couldn't they leave it as C, java, etc for loops?

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

      Interesting. What do you hate about them?

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

    It seems like enumerate will create a new list and duplicate the contents of the original. Then you loop over it and do whatever. You just increased the amount of memory used and made two loops instead of one.
    In the context of an actual program that probably doesn’t matter but without any given non-functional requirements it’s quite noobish to call this a noob-move. Maybe the list is huuuge and then this is a noob move.

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

      No, enumerate returns an enumerate object which is an Iterator, it does not create a new list nor it requires any significant memory compared to the size of list(basically its almost free operation, memory wise).

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

    I am meta-noobing. For when double-noob isn't sufficient noobification.

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

    I follow you 'cos you name and shame! 🤣🤣🤣I know I was under the table by the time you finished!

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

      😶 I shame myself most!

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

    Literally every tutorial I've ever seen showed me the noob ways. 🤣😂🤣😂🤣

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

      My tutorials have a lot of noob stuff in them too. Nobody is perfect!

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

    Cascading enumeration doesnt make sense to me. Thats why i use ranges

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

      Ah. That’s a good point.

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

    Why did someone decide Python was necessary? lol.

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

    literally need this right now !

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

    If you're incrementing a counter, odds are you just got done coding something in java or c

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

    Don’t be a noob, use a f-string, don’t be a noob don’t code in toy languages, code in c++, don’t be a noob code in C, don’t be a noob code in asm don’t be a noob code in binary

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

      01110101010101 01010101001010 1010100000010101 -> Sorry if the noob thing came off the wrong way, I was trying to make it over the top as a joke.

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

      just dont code you will not get called as a noob

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

    Why does he kinda sound like mordecai from regular show

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

      My kids would love to hear that! lol