How can i make a loop that repeats 10 times without having a counter, so i can put in what i want to not 1,2,3,4... | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How can i make a loop that repeats 10 times without having a counter, so i can put in what i want to not 1,2,3,4...

24th Jul 2016, 5:15 PM
Silver Night
Silver Night - avatar
3 Answers
+ 3
Some functions can be called with multiples arguments separated by a comma, and range() is one of them. let's you change the integer passed to range() to follow any sequence of integers, including starting at a number other than zero. For example: for i in range(12, 16): print(i)
24th Jul 2016, 6:51 PM
Francisco Gómez García
Francisco Gómez García - avatar
- 2
use range()
24th Jul 2016, 5:34 PM
Daniel Martin Garcia
Daniel Martin Garcia - avatar
- 2
a for loop with range()
25th Jul 2016, 12:40 AM
Daniel Hsu