Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # variable_generator.py
- def genVar(var_name,n):
- _gv = globals()
- for i in range(1, n+1):
- _gv[var_name + '_' + str(i)] = i * 100
- genVar('demo',3)
- print(demo_1)
- print(demo_2)
- print(demo_3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement