首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >pycharm怎么解决list index of range?

pycharm怎么解决list index of range?

提问于 2020-01-21 21:46:20
回答 0关注 0查看 211
代码语言:javascript
复制
def load_movies(self, filePath):
    """
    Load a csv file into movie objects in the list.
    """
    with open(filePath, 'r') as file:
        reader = csv.reader(file)
        for row in reader:
            # convert the years into number
            row[1] = int(row[1])
            # convert the status into is_watched
            if row[3] == "w":
                row[3] = True
            else:
                row[3] = False
            # append new movie info
            self.movies.append(Movie(*row))

回答

和开发者交流更多问题细节吧,去 写回答
相关文章

相似问题

相关问答用户
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档