如何删除"无"在代码输出中

时间:2014-08-26 11:37:29

标签: python python-2.7

如何在代码输出中删除“无”。我不想在代码输出中显示“无”

>>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

1 个答案:

答案 0 :(得分:0)

you.printname('shahram')

已打印名称

单独打印

you.printname('shahram')
print(you.mark)