Oct-28-2020, 05:29 PM
I don't understand what you mean by "I would like this as an input and not printing it out." so this may not be what you want.
pencils = [f'pencil{a}' for a in range(1, 10)] #or tests = ['test'+str(a) for a in range(1, 10)] #or numbers = [] for a in range(1, 10): numbers.append('number'+str(a))