How can i solve this q with python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

How can i solve this q with python

you are going to write a program that takes a string and checks if it contains consecutive vowels or not. It should give Positive as an output if it contains consecutive vowels and Negative otherwise. For example saetqi string contains a adjacent to e, which means that it contains consecutive vowels. So it should give Positive as an output. On the other hand, if you take the string of statoqag, the output should be Negative.

14th Oct 2020, 10:21 PM
Murat E
Murat E - avatar
2 Answers
- 1
create a list of vowels , Initialize a variable count with value 0, Then iterate over the string and check for each letter to see if it is in list of vowels ,if it is,then increment the count else initialize count with value 0 again ,when the iteration is over ,check to see if count is greater than or equal to 2 ,if it is return a positive value else negative
14th Oct 2020, 10:31 PM
Abhay
Abhay - avatar
0
Could you pls write sample code?
15th Oct 2020, 8:58 PM
Murat E
Murat E - avatar