
Did you know?
The ASCII code (Pronounced ask-ee) is a code for representing English characters as numbers, with each character assigned a number from 0 to 127. For example, the ASCII code for uppercase M is 77. The extended ASCII contains 256 characters (using numbers from 0 to 255).
To see a list of the most useful ASCII codes you can download our simplified ASCII helpsheet.
Using Python you can easily access ASCII values of a character using the ord() function. For instance ord(“M”) returns 77 and chr(77) returns “M”
Your Challenge
Write a Pyhon script that prompts the end-user to enter a word, e.g. “Hello”
The script should calculate the score of this word using the letter values (A=1, B=2, C=3…)
So if the use inputs the word “Hello” the script should output: 8 + 5 + 12 + 12 + 15 = 52%.
Solution
Using the ord() function it returns the ASCII code for the letter.
The ASCII code for A is 65, for B is 66 and so on. So by taking away 64 to the ASCII code we then get A=1, B=2, C=3 etc.
word = input("Type a word").upper()
wordScore=0
for letter in word:
letterValue=ord(letter) - 64
wordScore += letterValue
print(str(wordScore) + "%")
word = input("Type a word").upper()
wordScore=0
addition=""
for letter in word:
letterValue=ord(letter) - 64
if (addition==""):
addition = str(letterValue)
else:
addition = addition + " + " + str(letterValue)
wordScore += letterValue
print(addition + " = " + str(wordScore) + "%")

Solution...
The solution for this challenge is available to full members!Find out how to become a member:
➤ Members' Area
Computer programmers, web-designers, graphic designers often have to choose specific colours to design eye-catchy user interfaces. To do so they use colour codes which are used to uniquely identify each of the 16 million colours available on the RGB colour palette.
Your English teacher has asked you to write a description of your favourite imaginary pet. They want you to use plenty of adjectives in your description and suggest that you use a thesaurus to find synonyms to use in your description.













