Czesc, mam kod który wkleje poniżej i errora który jest w temacie. Jest to bardzo prosty wątek, ale nie wiem jak to zrobic. Licze na waszą pomoc.
Nie chce sie tutaj poprawnie kod wkleic przez to że uzywam 3 srednikow w kodzie, ale załączyłem plik.
class Telewizor(object):
def __init__(self, name, chanell=0, volumn=0):
self.name = name
self.chanell = chanell
self.volumn = volumn
def __str__(self):
rep = "Wybrales Telewizor marki " + self.name + "\n"
return rep
def volumnF(self):
v = input('nacijsnij 1 jezeli chcesz podglosic albo 0 jezeli chcesz sciszyc')
if v == '1':
self.volumn += 1
elif v == '0':
self.volumn -= 1
def chanellF(self):
c = input('na jaki kanal chcesz zmienic')
self.chanell = c
def option(self):
choice = None
while choice != "0":
print\
("
Options
0-zakoncz
1-podglos
2-zmien kanal
")
choice = input("wybierasz: ")
print()
if choice=="0":
print("Do widzenia")
elif choice=="1":
Telewizor.volumnF()
elif choice=="2":
Telewizor.chanellF()
else:
print("zly wybor")
def main():
tv = input("
jaki telewizor chcesz wybrac:
1. Panasonic
2. Samsung
3. LG
")
if tv == "1":
tv = "Panasonic"
tv_1 = Telewizor(tv)
print(tv_1)
elif tv == "2":
tv = "Samsung"
tv_1 = Telewizor(tv)
print(tv_1)
elif tv == "3":
tv = "LG"
tv_1 = Telewizor(tv)
print(tv_1)
else:
print("nie ma tkaiej marki")
tv_1.option()
main()