I want to make a function that can iterate through anything (n specified times) put in the parameter and generate with padding.
So lets say I have this function:
def generate_with_padding(tobeiterated, n, pad = None):
...
If I call using a string lets say: generate_with_padding('abcdefg', 10, '?')
I would like it to return:
a
b
c
d
e
f
g
?
?
?
I don't want to use indexing because I want to iterate through generators too. How can I approach this? Maybe I can use next()?