C-17-Q130mediumsingle_mcq
The vowel-list-based check if char in vowels: is more general than the match-based version because it:
The vowel-list-based check if char in vowels: is more general than the match-based version because it:
- aUses a faster algorithm
- bCan include both lowercase and uppercase vowels in one list
- cUses fewer lines of code only
- dAvoids using
print
ব্যাখ্যা
A list membership test like if char in vowels: lets you put all variants — both lowercase and uppercase vowels — into a single list and check them at once. A match would need a separate case (or combined pattern) for each, making the list approach more general.