-1

In Python how can I need to create a long list that I'm trying to avoid typing, the list looks lis this

brands = ['_1','_2','_3'... '_998']

I can create the list of numbers with a for loop, but I'm trying to use list comprehension for the characters which should be faster.

Thanks!

EGM8686
  • 1,492
  • 1
  • 11
  • 22

1 Answers1

1
my list=["_" + str(i) for i in range(1,999)]
cottontail
  • 10,268
  • 18
  • 50
  • 51
zerOpRiME
  • 360
  • 3
  • 8