-
-
Save klapauciuz/c4e64d5f489b42d58639afafd4ab6209 to your computer and use it in GitHub Desktop.
wonderful tricky python oneliner with open and close file and two nested loops one of which is generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with open('output.txt', 'a') as o:contents=[o.write('http://' + random.choice(['1', '2', '3', '4', '5']) + str(random.randrange(100, 1000)) + i + '\n') for i in ['one', 'two', 'три', 'four', 'V'] for x in xrange(100)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment