在我尝试添加或更改以下代码(没有成功)以使其正常工作之后,我现在正在尝试从你们那里获得帮助。这是一个python新手的作品,但不幸的是我也是,我不知道如何让它工作。我所用的文献,没有我能用的相同的例子。向你们大家问好
def fun (arg0 , arg ):
fun1 = None
for i in arg :
if i not in ' aeiouAEIOU ':
fun1 += 1
fun2 {i} = 1
fun3 =+ i
return [ fun1 fun2 fun3 ]
def morefun ( arrg ):
e, o, u = fun ( arrg )
print ('here : ', u)
print ('here , too : ', e)
o = list (o); o. sort ()
for n in o:
print n, end =' - '
print
par = 'Was it a car or a cat I saw ?'
morefun ( par )
所以我修复了代码并得到了输出(以我解释它的方式)。 这更是出于好奇
输出:
如前所述,代码的作用是: 1.打印不带元音和空格的字符串 2.打印字符串的长度 3.按字母顺序(Ascii)打印所有字母,字母之间带有“-”
一些评论:
相关问题 更多 >
编程相关推荐