123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
-
-
-
-
-
-
-
-
- '''
- Input texts are checked against a dictionary that assigns weights to different vowels.
- The script gives a score for a specific sentence.
- '''
- scrabble = {'a': 3, 'e': 1, 'i': 2, 'o': 4, 'u':4, 'y': 6}
- weights = 0
- sentence = "La vie est un mystère qu'il faut vivre, et non un problème à résoudre."
- words = sentence.split()
- for word in words:
-
- for letter in word:
-
- if letter in scrabble:
-
- weight = scrabble[letter]
-
- weights += weight
- print("Le poids de ma phrase est:", weights)
|