This commit is contained in:
2025-12-19 09:44:23 +01:00
parent 2e5ed5bdf4
commit 90028384c4

View File

@@ -1,10 +1,10 @@
class Computer:
def __init__(self, info: str, typ: str):
def __init__(self, info: str, typ: str, speed: int):
print("Startujemy...")
# definicja właściwości obiektów tej lasy
self.procesor = "CPU at start"
self.speed = "5 GHz"
self.cpu_speed = 5000
self.cpu_speed = speed
self.informacja = info
self.typ = typ
@@ -23,7 +23,7 @@ class Computer:
# missing 1 required positional argument:
# 'info'
komputer1 = Computer("Komputer z lat 90tych", "XT", 1200)
komputer2 = Computer("Inna informacja", "AT")
komputer2 = Computer("Inna informacja", "AT", 4000)
print(komputer1)
print('-------------------')