定义函数0
#!/usr/bin/env python
#!@File:.py
spam =[‘apples’,‘banana’,‘tofu’,‘cats’]
def mart():
stream=’’
for i in range(len(spam)-1):
stream=stream+spam[i]+’, ’
stream=stream+‘and’+spam[-1]
return(stream)
#spam=[‘11’,‘22’,‘33’,‘44’,‘55’]
mart(spam)
TypeError: mart() takes 0 positional arguments but 1 was given
求指教哪里出错了。