You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An extension of #4
The function range(start,stop,step) can be replaced with enumerate(islice(iterable,start,stop,step)) or even just islice if the index isn't used out of the assign.
for example
foriinrange(3,len(seq),2):
x=seq[i]
...
can be replaced with
forxinislice(seq,start=3,stop=None,step=2):
...
or in the case of a sequence (and not just an iterator) even
forxinseq[3:-1:2]:
...
The text was updated successfully, but these errors were encountered:
An extension of #4
The function
range(start,stop,step)
can be replaced withenumerate(islice(iterable,start,stop,step))
or even justislice
if the index isn't used out of the assign.for example
can be replaced with
or in the case of a sequence (and not just an iterator) even
The text was updated successfully, but these errors were encountered: