Don't.
How would you know in your program to address that dictionay anyhow? If the user "customizes" the variables name? This sounds like an xy-problem.
You could store the user input in a dict as well:
sillyDict = { input("Insert name") : { "sets": 3, "reps": 12, "weight": 100}}
but to what purpose - how are you going to use it? You would need to know about the given name or iterate over the whole dict if you want to do anything with it.
It looks as if what you really need are classes and lists:
class Exercise:
"""Capsules data for one exercise. sets/reps/weigh have defaults."""
def __init__(self, name, sets = 3, reps = 12, weight = 100):
"""'name'd exercise with sets/reps/weight - using defaults:
sets = 3, reps = 12, weight = 100"""
self.name = name
self.sets = sets
self.reps = reps
self.weight = weight
def __str__(self):
"""Friendly representation of this exercise"""
return f"{self.name}: {self.sets} sets of {self.reps} reps with {self.weight} kg"
def __repr__(self):
return str(self)
# create a plan
plan = [ Exercise("Squats"), Exercise("BenchPress",3,5,180), Exercise("Pullups",5,22,10)]
# add one by user input (fragile) - no int-validation
plan.append( Exercise(input("What to do? "),
int(input("Sets: ")),
int(input("Reps: ")),
int(input("Weight: "))))
for exer in plan:
print(exer)
print(plan)
Output:
What to do? Burpies
Sets: 5
Reps: 15
Weight: 0
Squats: 3 sets of 12 reps with 100 kg # uses the default values
BenchPress: 3 sets of 5 reps with 180 kg
Pullups: 5 sets of 22 reps with 10 kg
Burpies: 5 sets of 15 reps with 0 kg
[Squats: 3 sets of 12 reps with 100 kg, BenchPress: 3 sets of 5 reps with 180 kg,
Pullups: 5 sets of 22 reps with 10 kg, Burpies: 5 sets of 15 reps with 0 kg]