用户:wrmdcxy查看:2 回复:8 评论:2 创建时间:2020-05-30T17:11:35
代码:
class test(object):
def __init__(self,string,stringh):
self.string=string
self.stringh=stringh
self.te=3
self.sort()
self.zl()
self.wuliao()
self.arwu()
def sort(self):
for x in range(self.te):
self.string+=self.stringh
def zl(self):
self.string=self.string[0:11]
def wuliao(self,aa=10):
for x in range(aa):
self.string+="1111111121312dd"
def arwu(self):
self.string=self.string[0:11]
def __str__(self):
return self.string
ttt=test("Hello","Python")
ttt.wuliao()
ttt.arwu()
print(ttt)
哈哈哈皮一下很开心~