Bryce H.

asked • 01/23/23

indentation error

sentence = input("Enter a word:")
vowel_count = 0
for i in sentence:
if(i == "a" or i == "e" or i == "i" or i == "o" or i == "u"):
vowel_count = vowel_count + 1
print("Total vowel count :", vowel_count)

why am i getting in indentation error.

2 Answers By Expert Tutors

By:

Bryce H.

It is still giving me the error that way as well.
Report

01/23/23

Bradley T.

tutor
This does not give me any errors when I run it. The other possible reason is if you have mixed spaces and tabs as indentations. I would suggest going through the code, and deleting every indent until it is flush to the left and then reindenting with the tab key. This is not an error of your code being wrong, its just something wrong with the spacing at the beginning of the lines.
Report

01/24/23

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.