如何在代码输出中删除“无”。我不想在代码输出中显示“无”
>>class class1:
name='civil'
def printname(self,name):
print self.name
print name
>>you=class1()
>>you.mark=100
>>print you.printname('shahram'),you.mark
civil
shahram
None 100
答案 0 :(得分:0)
you.printname('shahram')
已打印名称
单独打印
you.printname('shahram')
print(you.mark)