I am doing a python project in which I want to create several variables that all hold the same information; however, I cannot figure this out on my own.
Instead of writing:
a = 1
b = 1
c = 1
and so on, I want to automate this process. Here are some examples of what I have tried so far:
Example 1:
random.randint(0, 100) = 1
Example 2:
str(random.randint(0, 100)) = 1
Example 3:
class makevariable:
random = 0
setattr(makevariable, 'random', random.randint(0, 1000))
getattr(makevariable, 'random') = 1