I am calculating the ord values of the user input and adding the value of each letter of the word they enter. I am trying to divide the sum (of the word value) by 100 but when I do that, it just prints out as 0.00. Is there an order issue or my function is wrong?
key_word = "quit"
word = ""
while word != key_word:
word = input(str("Enter a word: "))
word = word.lower()
total = float(0)
cent_value = float(100)
for letter in word:
value = ord(letter)
character = float(value - 96)
total += character
cent_value = cent_value / total
print("Your word is worth $", "{0:.2f}".format(cent_value), sep="")
if word == key_word:
print(end="")