Day 33: Python Sort by Vowels, Custom Sorting Fruits by Vowel Count with Keys
dev.to·9h·
Discuss: DEV
Flag this post

Welcome to Day 33 of the #80DaysOfChallenges journey! Today’s beginner challenge is on sorting a list of words by the number of vowels they contain, using a helper function as the key for sorted() to count a’s, e’s, i’s, o’s, u’s case-insensitively. This sharpens custom sort logic, string iteration, and lambda alternatives, handy for text sorting or analysis tasks. If you’re getting into keys for sorting or counting in strings, this “Python sort by vowels” tutorial highlights a function pair that’s clean and extends to other criteria like consonants or length.


💡 Key Takeaways from Day 33: Vowel Sort Functions

This task features a counter function feeding into sorted() for vowel-based order, with fewer vowels first. It’s a prime example of modular sorting: define…

Similar Posts

Loading similar posts...