Oct-21-2019, 01:34 AM
It would be better to do it in a dictionary rather than a list:
POINTS = {'a': 5: 'b': 3, 'c': 7, 'd': 2, 'e': 1, 'f': 9}Then the function is simpler:
def length(x, y): print(f'{x} = {POINTS[x]}') print(f'{y} = {POINTS[y]}') print(f'The length of {x}{y} is {POINTS[x] + POINTS[y]}')
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures