# Input string
text = "Hello World, this is Python!"
# Convert to lowercase and use list comprehension with count
vowels = "aeiouAEIOU"
# Use sum and map to count vowels without any loops or if
vowel_count = sum(map(text.count, vowels))
print("Number of vowels:", vowel_count)
Comments
Post a Comment