summaryrefslogtreecommitdiff
path: root/wk6/pset/sentimental-readability/readability.py
blob: 7e06180fa9ad92d962c6f3893caa92e81d085544 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from cs50 import get_string

text = get_string("Text: ")

s = 0.0 # sentences
w = 1.0 # words
l = 0.0 # letters
c = ''

for i in range(len(text)):
    c = text[i]
    j = ord(c.lower())
    if c == '.' or c == '!' or c == '?':
        s += 1
    elif c == ' ':
        w += 1
    elif