【发布时间】:2021-12-25 23:31:41
【问题描述】:
您好,我是一名 C# 程序员,但我认为学习 python 也很好,所以我正在学习 python 我有这段代码
def disemvowel(string_):
for n in string_:
if(n is 'a' or 'e' or 'u' or 'o' or 'i'):
string_ = string_.replace('n' , '')
return string_
print(disemvowel('Hello'))
我声明了一个从字符串中删除元音的函数我搜索了它的问题但我找不到任何东西我什至将替换函数的返回值传递给字符串然后传递它我的代码问题是什么? 谢谢你的回答
【问题讨论】: