I need a pit of help. I am currently learning python, and I have python 2.7.8 I am looking to build a simple program that will help to count the vowels in my word. Here is the code:
count = 0
total = 0
for v in "bonbon":
count += 1
if v == 'e' or v == 'o' or v == 'u' or v == 'a':
print('the number of vowel in your word is ' +str(total))
Why does it print twice? 1- the number of my vowel is 0 and then the number of my is 2
Could someone help me please? Thanks guys
{}. If you select your code and click this button it is automatically correctly indented, and displayed correctly in the question.