Apr-05-2020, 10:26 AM
if i need to run a short little loop of just a constant two or three steps, which is preferred?
or
the above are examples for a loop of two steps. a like question is presented for a loop of three steps. IOW, should we always use range() for constant loops even for short loops like two or three? or can we use literal tuples in these short cases? this question is about what is preferred by others than about language rules or requirements. this could refer to coding style requirements or just coding pythonic.
or, what is you preference?
1 2 3 |
for x in range ( 2 ): print ( f 'this is step {x}' ) ... |
1 2 3 |
for x in ( 0 , 1 ): print ( f 'this is step {x}' ) .... |
or, what is you preference?
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.