+ 2

How to increment by for loop

like: page1, page2 ....

15th Aug 2018, 7:20 PM
Iman Rafi
Iman Rafi - avatar
5 Answers
+ 8
iman rea try this: for i in range(1, 10): print("page" + str(i))
15th Aug 2018, 7:39 PM
Eduardo Petry
Eduardo Petry - avatar
+ 6
Are "page1, page2, ..." objects/variables? If so, you can put them in a list and iterate over the list, like this: pages = [page1, page2, ...] for page in pages: # do something with the page
15th Aug 2018, 7:24 PM
Eduardo Petry
Eduardo Petry - avatar
+ 3
num = 1 for i in range(1, 10): print("page " + str(num)) num = num + 1
15th Aug 2018, 7:25 PM
Dread
Dread - avatar
+ 2
Can't concatenate str and int!!!
15th Aug 2018, 7:37 PM
Iman Rafi
Iman Rafi - avatar
+ 2
got it... thanks a lot 👍👍
15th Aug 2018, 7:40 PM
Iman Rafi
Iman Rafi - avatar