mardi 12 février 2019

How would I approach the following question?

"Suppose we calculate the vowel value of a word based on the following rubric:

a - 5 points e - 4 points i - 3 points o - 2 points u - 1 points"

I did:

https://pastebin.com/gDwRxqG7

a = 5
e = 4
i = 3
o = 2
u = 1

input5 = input("enter word")
for letter = a in input5:
 print("+5 points")
for letter = e in input5:
 print("+4 points")
for letter = i in input5:
 print("+3 points")
for letter = o in input5:
 print("+2 points")
for letter = u in input5:
 print("+1 point")

Aucun commentaire:

Enregistrer un commentaire