Get the App
SLTechnology News&Howtos  ›  Development  › 

How to realize vowel Statistics in python

Shulou Source: shulou.com Published: 2022-06-01 05:15:29 10月24日 Update

This article mainly shows you "how to achieve vowel statistics in python". The content is simple and clear. I hope it can help you solve your doubts. Let me lead you to study and learn this article "how to achieve vowel statistics in python".

Vowel statistics

The following method counts the number of vowels in the string ('a sound,'e sound, 'isound,' oval,'u'), which is done through a regular expression.

Import re def count_vowels (str): return len (len (re.findall (r'[aeiou]', str, re.IGNORECASE)) count_vowels ('foobar') # 3 count_vowels (' gym') # 0python what are the five characteristics of python: 1. It's easy to learn, and when you develop a program, you focus on solving problems, not understanding the language itself. two。 Object-oriented, compared with other major languages such as C++ and Java, Python implements object-oriented programming in a very powerful and simple way. 3. Portability, Python programs can run on a variety of platforms without modification. 4. Explanation, programs written in Python do not need to be compiled into binary code and can be run directly from the source code. 5. Open source, Python is one of FLOSS (Free / Open Source Software).

The above is all the contents of the article "how to achieve vowel Statistics in python". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Vowels statistics programs content articles languages objects features learning help running power freedom number binary code characters strings platforms methods Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Shulou Tech Info Apple MySQL Shulou Technology