Counting number of vowels in a string in Python -


ठीक है, तो मैंने जो किया था

  def countvowels (st): result = st गिनती ( "एक") + st.count ( 'ए') + st.count ( "e") + st.count ( 'ई') + st.count ( "मैं") + st.count ( "मैं" ) + St.count ("o") + st.count ("ओ") + st.count ("u") + st.count ("यू") रिटर्न परिणाम  

यह काम करता है (मुझे पता है कि इस पोस्ट में गलत संकेत हो सकता है, लेकिन जिस तरह से मैंने इसे अजगर में दबाया है, यह काम करता है)।

क्या ऐसा करने का एक बेहतर तरीका है? Loops के लिए प्रयोग?

मैं कुछ ऐसा करूँगा

  def countvowels (एसटी): रिटर्न लेन ((सी के लिए सी में सी 'एलईईओ' में) सी) कम   

Comments

Popular posts from this blog

Active Directory Authenticated Proxy Server with Squid or CNTLM -

java - @PluginTarget(Node.class) not registering as neo4j plugin -

python - Calculate STD manually using Groupby Pandas DataFrame -