【发布时间】:2018-05-03 01:59:34
【问题描述】:
我有 2 个 txt 文件,我需要从 fileA 中获取一个值,将其与 fileB 匹配并打印结果。
fileA 包含用户 ID、艺术家 ID 以及艺术家 ID 已播放的次数。 fileB 包含艺术家 ID 和艺术家的姓名。
我需要编写一个函数来告诉我某个用户播放了某位艺术家的次数。我需要打印艺术家的名字和次数。我完成了伪代码,但无法继续前进。
def printListenersTimesPlayed(userID)
find all artists and number of time they've been played from fileA
find the name of the artist from fileB
print list of artists and times that the user (userID) has played
感谢任何帮助!
【问题讨论】: