title. But the constructor stores the film's name in capitals under that same name.
class Film:
def __init__(self, name):
self.title = name.upper()
def title(self):
return "film"
movie = Film("up")
print(movie.title())
What happens when the program runs?Log in to join the discussion.
Loading…