Computer Science, asked by saihari96, 10 months ago

read a text file and display the number of vowels/consonants/uppercase/lowercase characters in the file in python ​

Answers

Answered by umershahzad4466
1

Answer:

print("Enter the Name of File: ")

fileName = str(input())

fileHandle = open(fileName, "r")

tot = 0

vowels = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U']

for char in fileHandle.read():

if char in vowels:

tot = tot+1

fileHandle.close()

print("\nTotal Vowels are:")

print(tot)

Similar questions