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