“Zählen Sie, wie viele Vokale in einem String -Python” Code-Antworten

Zählen Sie, wie viele Vokale in einem String -Python

def vowel_count(string):
  vowels = ['a', 'e', 'i', 'o', 'u']
  return len([i for i in string if i in vowels])
the real Professor Poopypants

Finden Sie die Anzahl der Vokale in String Python

string = list(map(str, input().lower()))
lst = []
for i in range(0, len(string)):
  if string[i]=='a' or string[i]=='e' or string[i]=='i' or string[i]=='o' or string[i]=='u':
    lst.append(string[i])
print(len(lst))
vip_codes

Python -Programm zum Zählen von Vokalen in einer Zeichenfolge

whatever=input("Enter something\n")
vowels = ['a', 'e', 'i', 'o', 'u']
vowelp = ([i for i in whatever if i in vowels])
vowelcount = len([i for i in whatever if i in vowels])
print ("there are", vowelcount, "vowels (y is not counted)")
print ("the vowels are:", vowelp)
i dont know what to put here

Ähnliche Antworten wie “Zählen Sie, wie viele Vokale in einem String -Python”

Fragen ähnlich wie “Zählen Sie, wie viele Vokale in einem String -Python”

Weitere verwandte Antworten zu “Zählen Sie, wie viele Vokale in einem String -Python” auf Python

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen