Files
2025_12_15_python/dzien_04/przyklady/klasy_02.py

23 lines
497 B
Python

class Computer:
def __init__(self):
print("Startujemy...")
# definicja właściwości obiektów tej lasy
self.procesor = "CPU at start"
self.speed = "5 GHz"
self.cpu_speed = 5000
komputer1 = Computer()
komputer2 = Computer()
print(komputer1)
print(dir(komputer1))
print(dir(komputer2))
print(komputer1.procesor)
print(komputer2.procesor)
komputer1.procesor = "AMD M6"
print('-------------------')
print(komputer1.procesor)
print(komputer2.procesor)