I am looking for a function or a way, something similar to os.listdir(), however, I need to add the dir various times into the list depending on the path. For example:
os.listdir(path)
Output:
['Bacon.png', 'Basics.png', 'Cabbage.png', 'Elf.png', 'Flip Flop.png', 'Prisoner.png', 'Santa Blue.png']
I need something like this:
['Bacon','Bacon','Bacon','Bacon', 'Basics', 'Basics', 'Cabbage', 'Elf', 'Elf', 'Elf', 'Flip Flop', 'Prisoner', 'Prisoner', 'Santa Blue']
Basically, I need to multiply the number of times listdir imports the path or item into the list. Thank you for any help and interactions.
repetitions()is a function you can write that determines the number of times the filename should be multiplied.