pikapython/examples/Class/classpar1.py

14 lines
176 B
Python
Raw Normal View History

2022-07-01 09:17:33 +08:00
class Test:
a = 1
b = 'test'
def __init__(self):
2022-07-01 09:37:09 +08:00
self.a = 2
self.b = 'pewq'
2022-07-01 09:17:33 +08:00
print(Test.a)
print(Test.b)
2022-07-01 09:37:09 +08:00
test = Test()
print(test.a)
print(test.b)