Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren0
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)
7 Antworten
+ 4
Regular expressions
https://code.sololearn.com/cbZwyvcUSZVw/?ref=app
+ 3
I would definitely recommend to check out regular expressions. They can make your life as a programmer a lot easier ☺️
+ 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
+ 1
Just a Hint:
https://code.sololearn.com/crTEbXVpTjYR/?ref=app
+ 1
I will 👍 Thanks Anna
0
any other options without using regular expressions?
0
it seems the best way is RE