Python File Output, Looping, and Increasing -


number = 1 name = 'frames' + str(number) + '.html' usednumbers = [] if number in usednumbers:     number += 1 else:     open(name,'w')   

how go doing 'number' increases 1, puts out html document, until gets 18, stops before gets 19? ("frames1.html. frames2.html, ..., frames18.html")

just use loop, like:

for number in range(1,20):     # rest of stuff. 

resources on for loops , range.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -