for x in range(0, 9): globals()['string%s' % x] = 'Hello' # string0 = 'Hello', string1 = 'Hello' ... string8 = 'Hello'

how to create dynamic variable names in python

Similar Code Examples