2024-09-30 20:35:42 发布
网友
用户提供未定义数量的字符串作为输入;我们必须计算用户提供的字符串数
我试过:
def count(terms*): # Example count('IloveU','Iwantyou','No') count = 0 for term in terms: count += 1 print (count)
多谢各位
差不多了: Asterix必须在参数前面,而不是在末尾
def count(*terms): # Example count('IloveU','Iwantyou','No') count = 0 for term in terms: count += 1 print (count)
差不多了: Asterix必须在参数前面,而不是在末尾
相关问题 更多 >
编程相关推荐