I am trying to learn python 3.x. Below is a simple program I wrote-
class Movie:
def __init__(self, movieName,movieTitle,movieHero):
self.name =movieName
self.title =movieTitle
self.hero =movieHero
def movieDetails(self):
print (self.name,self.title,self.hero)
detailsOfMovie= []
while True:
a,b,c = [x for x in input("Enter movie, title, hero").split(",")]
m=Movie(a,b,c)
detailsOfMovie.append(m)
option = input ("Do you want to print another movie [Yes or No]:")
if option.lower() == 'no':
break
for x in detailsOfMovie:
print(x)
BUT it returns the below result-
Enter movie, title, hero df,df,df
Do you want to print another movie [Yes or No]:no
<__main__.Movie object at 0x00000221EF45FC88>
Process finished with exit code 0
Question Is: Why did it not print the items in the list detailsOfMovie?