Finding Vowels and Consonants (Python) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Finding Vowels and Consonants (Python)

What is your advise for finding one or two vowels before or after one or two consonants!? Take (CVCV) Lead(CVVC) Click(CCVCC)

14th Dec 2018, 10:36 AM
Dolan
Dolan - avatar
7 Answers
14th Dec 2018, 12:24 PM
Anna
Anna - avatar
+ 3
I would definitely recommend to check out regular expressions. They can make your life as a programmer a lot easier ☺️
15th Dec 2018, 10:00 AM
Anna
Anna - avatar
+ 2
You can do everything manually. But this will be a lot more work. Here's a sample that will find combinations of one or two consonants followed by one vowel: https://code.sololearn.com/cxxVZ87czujX/?ref=app If you want to include all possibilities, the code will be a lot more complex and more difficult to maintain
15th Dec 2018, 6:46 AM
Anna
Anna - avatar
15th Dec 2018, 8:46 AM
Sebastian Keßler
Sebastian Keßler - avatar
+ 1
I will 👍 Thanks Anna
15th Dec 2018, 10:15 AM
Dolan
Dolan - avatar
0
any other options without using regular expressions?
15th Dec 2018, 4:25 AM
Dolan
Dolan - avatar
0
it seems the best way is RE
15th Dec 2018, 9:58 AM
Dolan
Dolan - avatar