Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make a list in Python like (0,6,12, .. 144)?

Tags:

python

list

I am not sure, whether I should use for -loop. Perhaps, like

for i in range(145): 
  by 6:    //mistake here?
  print i
like image 228
Léo Léopold Hertz 준영 Avatar asked Dec 02 '22 08:12

Léo Léopold Hertz 준영


1 Answers

for i in range(0,150,6):
     print i

if you are stepping by a constant

like image 187
Nikron Avatar answered Dec 03 '22 21:12

Nikron