在传入可变参数时传入后参数为tuple
class Student(object):
def __init__(self, name, score):
self.name = name
self.score = score
def print_score(self,*testcha):
print('%s:%s'%(self.name,self.score))
#注意:此处无需对testcha长度进行判断
for i in testcha:
print('%s'%i)
wang=Student('wang',21)
wang.print_score()