python add variable to function dynamically

for i in range(0, 9):
    globals()[f"my_variable{i}"] = f"Hello from variable number {i}!"

# Hello from variable number 3!

Here is what the above code is Doing:
1. We create a for loop that iterates 9 times.
2. We create a new variable using the f-string syntax.
3. We assign the new variable a value.
4. We print the value of the third variable.

You can use this same technique to create a dictionary of variables.