OpenSourceCornell / Spring_2018_WICC_OSC

The Git Workshop for the Spring 2018 WICC and Open Source Cornell Introduction to Open Source event.
1 stars 21 forks source link

wordValue #56

Open alexanderGGreenberg opened 6 years ago

alexanderGGreenberg commented 6 years ago

Implement the funciton in src/wordValue.py with the following specification:

given a dict of letter to numeric value mappings, calculate the value of the given word example valueDict = {'o': 3, 's': 7} word = 'os' return 3+7 = 10

thejxp commented 6 years ago

🙋🏻

cjfragoso commented 6 years ago

valueDict = {'o':3, 's':7} word = [] for key in valueDict.keys(): word.append(key) result = [] for letter in word: result.append(valueDict[letter]) total = sum(result) ???

ammar0211 commented 6 years ago

I got this!!