Exemplo n.º 1
0
import functions2
text = functions2.wordTools()
text = text.fileToString("someText.txt")


######## VOWEL COUNT ########
vowels = ("a", "e", "i", "o", "u")
vcount = 0
for letter in text:
    if (letter.lower() in vowels):    #####program takes each letter, converts it to lower case and counts it
        vcount = vcount + 1
        
        
######## CONSONANT COUNT ########
consonants = ("b","c","d","f","g","h","j","k","l","m","n","p","q","r","s","t","v","w","x","y","z")
ccount = 0
for letter in text:
    if (letter.lower() in consonants):    #####program takes each letter, converts it to lower case and counts it
        ccount = ccount + 1
        
        
######## SENTENCE COUNT ########
sentence = ("?",".",)
scount = 0
for letter in text:
    if (letter in sentence):    
        scount = scount + 1
        
        
######## WORD COUNT ########
words = (" ")