def abc(s):
filter = [i for i in s.lower() if i in 'abcdefghijklmnopqrstuvwxyz']
for i in range(len(filter) - 1):
if filter[i] > filter[i+1]:
return print(s, "is not abcdearian")
return print(s, "is abcdearian")
while True:
try:
s = input("String? ")
abc(s)
我在制作abc(s)的递归版本方面遇到了麻烦。有什么想法吗?
def abc(s): ... abc(subs)... return
吗?具体来说,我是指递归需要在函数体内使用其他参数调用函数。 - Nisan.H