TypeError:__ init __()需要4个参数(给定5个)udacity

时间:2018-03-10 06:41:56

标签: python

enter image description here在此输入代码 class Movie():

def __init__(self, movie_title, move_storyline , trailer_youtube):
    self.title = movie_title
    self.storyline = move_storyline
    self.poster_image_url = poster_image_url
    self.trailer_youtube_url = trailer_youtube

enter image description here

这里是谁呢!

1 个答案:

答案 0 :(得分:2)

您撰写self.poster_image_url = poster_image_url但似乎忘记在poster_image_url的参数中加入__init__。添加它,参数和参数的数量将正确匹配。