0%
简介
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
| a = 12 b = [1,2] def test(): try: a += 1 print(a) except: pass print(b,' ',*b)
test()
class Person(): def __init__(self,name,age=None): self.name = name self.age = age print(' __Init__ was where')
def run(self): print(f'{self.name}在奔跑') def jump(self): print(f'{self.name}在跳跃') def work(self): self.run() self.jump() def sleep(name): return name result = sleep(self.name) print('sleep result is',result) def sleep_1(): print('sleep_1 ')
xiaomu = Person(name='xioamu',age= 18) xiaomu.name= 'xiaomu_11' xiaomu.jump() dewei = Person(name= 'chen') dewei.jump()
dewei.top = 174 print(dewei.top)
print(dewei.age) print('~~~~~~~~~~~~~')
xiaomu.work()
|