9.Movie-python fundamentals-wrong output
Здравейте хора,
Някой има ли идея защо този прост код не работи коректно? Задачата е "9.Movie" от python fundamentals/ object and classes - exercises.
class Movie:
__watched_movies = 0
def __init__(self, name, director):
self.watched = False
self.name = name
self.director = director
def __repr__(self):
return (f"Movie name: {self.name}; Movie director: {self.director}. Total watched movies: {self.__watched_movies}")
def change_name(self, new_name):
self.name = new_name
def change_director(self, new_director):
self.director = new_director
def watch(self):
if not self.watched:
self.watched = True
self.__watched_movies += 1