15

When u trynna shift from C coding pattern to pythonic 😊

Comments
  • 2
    "when you write python code"
  • 0
    What. How do you do this then?
  • 2
    @nitwhiz With a for each loop iterating over a generator that spits out a range. Because python
  • 2
  • 0
    when you write inc(i) in pascal code
    and you never need to deal with diff between post-increment and pre-increment
  • 1
    I learned this the hard way 😅 Coming from JavaScript. Also
    i = i + 1 reassigns i, where i += 1 increments i by 1, they are not equivalent (despite what many stack overflow answers might tell you)
    One uses __iadd__ and the other __add__
Add Comment