def anti_vowel(text):
empL = [] #just an empty list
index = 0 #just an index counter
empS = "" #just an empty String
for i in text:
empL.append(i) # in this loop ill be adding the str passed in by "text" char by char to the empty list
else: # since this its a for/else loop this is also going to run
for char in empL: # iterates to each element in the list
if char in "aeiouAEIOU": **# if the element thats being iterated at the moment is cotained in this string**
empL.remove(char) #remove it
else: #yes this is going to run because it's another for/else
sizeEmpL = len(empL) # just the size of empty list
while sizeEmpL != 0 :
empS = empS + empL[index]
print(empS)
index += 1
sizeEmpL -= 1
print(empL)
print(empS)
を失敗します文字列 "aeiouAEIOU"と比較された各charをチェックし、比較されたcharが "aeiouAEIOU"のいずれかを含んでいる場合、それを削除するはずです。 次に、要素を空の文字列に追加し、vowelless文字列を出力します。私は自分のオリジナルの方法で抗母音PROGを作成しようとしていますが、何らかの理由で1つの母音はprogがとても基本的に私は、PROGを置くことになっているパラメータとして文字列を渡すことになってる
を助け
希望:あなたはそれの機能を作ることができます
? – blacksite
予想される出力と実際の出力の入力を記述します。 –
''' .join(c.lower()が 'aeiou'に含まれていない場合はcのテキスト)' –