Also, when you'd need to append 'a lot' to the same list, you could shortcut k+=[1] to a=k.append; now you can a(1). (save 2 chars per append; becomes profitable when you need N appends where N*len('k+=[]')>len('a=k.append')+N*len('a()') <=> N>5)
k+=[1]
k+=[2]
k+=[3]
k+=[4]
k+=[5]
vs
a=k.append
a(1)
a(2)
a(3)
a(4)
a(5)
Now I'm having fun :)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Also, when you'd need to append 'a lot' to the same list, you could shortcut
k+=[1]
toa=k.append
; now you cana(1)
. (save 2 chars per append; becomes profitable when you need N appends whereN*len('k+=[]')>len('a=k.append')+N*len('a()')
<=> N>5)vs
Now I'm having fun :)