+ 37
[ ASSIGNMENT: ] Word Values
Given a String "abc" and assuming that each letter in the String has a value equal to its position in the alphabet ("abc" has a value of 6) This means that a=1, b=2, c=3 ... z=26 TASK : Given a list of strings. Return the values of the strings multiplied by the position of that String in the list. Position begins with 1 Example :: nameValue ["abc", "abc abc"] return [6, 24] because of [ 6*1, 12*2 ]. Spaces are ignored! NOTE : Input will only contain lowercase characters and spaces! HappyCodings!:-)
23 ответов
+ 25
+ 18
If I have the time and if I'll manage to I'll try to do it in other programming languages but for now here's my try:
https://code.sololearn.com/cQKY4dHkNmDg/?ref=app
https://code.sololearn.com/cQl95DyHrY7K/?ref=app
https://code.sololearn.com/c1q7WqAY896t/?ref=app
https://code.sololearn.com/cCqETuovXzJ3/?ref=app
+ 17
Hello, 🤗
Flash do you want my answers (are they so interesting! 😆) or you want to solve the tasks and show the way and solution from which something new can be learned👍
No, you will not find my solution 😄🤘
I'm glad you're participating and writing java one-liners 👍😉🍻
+ 15
Morpheus 💪Indeed my friend! 😄😀👏👏
+ 15
Flash why to hide them when you are so interested, 😁😉👌
I am really honored, 👏🍻
thank you very much for your interest! 👍😊
+ 11
https://code.sololearn.com/c86oWngLwDMa/?ref=app
+ 10
v=lambda l:sum(n*(sum(map(ord,s))-96*len(s)) for n,s in enumerate(" "+l))