+ 1
here is an example of a string generator: def words(string):     for i in range(5):         yield string + str(i) it takes the string as parameter and then generates 5 versions of that string with numbers at the end. so, running the following code: for word in words("onion"):     print(word) would produce: onion0  onion1  onion2  onion3  onion4
13th Jul 2016, 7:43 AM
RedAnt
RedAnt - avatar