python中,拼接字符串较为特殊,需要以 正确写法为: msg = ‘我有%d’%(self.num) + ‘~~~果’ 错误写法为: msg = ‘我有’ + (self.num) + ‘~~~果’