Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
例如,如何在 python 中计算元音
'XaXeXUU'
应该给我答案 4
我怎么计算这个?
len(my_string)-len(my_string.lower().translate(None,'aeiou'))
my_string = 'XaXeXUU' vowels = 'aeiou' sum(ch in vowels for ch in my_string.lower())