Skip to content

Instantly share code, notes, and snippets.

@minorsecond
Created June 17, 2015 14:31
Show Gist options
  • Save minorsecond/6629ae32ab6a8847a389 to your computer and use it in GitHub Desktop.
Save minorsecond/6629ae32ab6a8847a389 to your computer and use it in GitHub Desktop.
This should return True but doesn't. The dict 'warmup_weight' is constructed in such a weird way. It should appear just like 'warmup_test.'
def warmup(weights):
warm_perc = [.5, .6, .7, .85]
warmup = [] # list of warmup weights
weights = {'squat': 100, 'bench': 100, 'row': 100, 'ohp': 100,
'deadlift': 100} # dict of user's working set weights
warmup_weight = weights
# The values I want...
warmup_test = {'squat': [50, 60, 70, 85], 'bench': [50, 60, 70, 85], 'row': [50, 60, 70, 85],
'ohp': [50, 60, 70, 85], 'deadlift': [50, 60, 70, 85]}
for key, value in warmup_weight.items():
for i in warm_perc:
# Create a list of warmup weights for each lift.
warm = value * i
warmup.append(warm)
warmup_weight['{0}'.format(key)] = warmup
print(warmup_weight == warmup_test)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment