Back to Browse

Word Score - 27 April 2026 - Python Version on freeCodeCamp

2 views
Apr 27, 2026
3:31

Daily Coding Challenge on Word Score (27 April 2026) - freeCodeCamp. Link to Challenge at https://www.freecodecamp.org/learn/daily-coding-challenge/2026-04-27 Given a word, the aim is to return its score, using a = 1, b = 2, , c = 3, etc. Upper and lowercase values have the same value. Call the function get_word_score, passing the word (e.g. "hi") as a parameter and print it out. In the function get_word_score, set the word_score to 0. Use a for loop to iterate over the word. Check if the character is an uppercase letter. If the character is an uppercase letter, get the Unicode code point, subtract 64 and add it to the word score. If the character is not an uppercase letter, check if the character is a lowercase letter. If the character is a lowercase letter, get the Unicode code point, subtract 96 and add it to the word score. Continue until every character in the word has been seen. Then return the word score. get_word_score("hi") should return 17, get_word_score("hello") should return 52, get_word_score("hippopotamus") should return 169, get_word_score("freeCodeCamp") should return 94.

Download

0 formats

No download links available.

Word Score - 27 April 2026 - Python Version on freeCodeCamp | NatokHD