Skip to content

Commit 57a96e1

Browse files
author
Fanli Lin
committed
Solved Question 1
1 parent 9c85440 commit 57a96e1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

topartists.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
artists = artists.sortByKey(False)
2525
#write all artists
2626
text_file = open("topartists.txt", "w")
27-
for song in artists.collect():
28-
text_file.write(str(song[0]) + ", " + song[1].encode("utf8"))
27+
for artist in artists.collect():
28+
text_file.write(str(artist[0]) + ", " + artist[1].encode("utf8"))
2929
text_file.write("\n")
3030
text_file.close()
3131
#===========================================================================

topartists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
104060, Ed Sheeran
1+
104060, Ed Sheeran
22
56807, The Chainsmokers
33
38740, Drake
44
32184, Imagine Dragons

0 commit comments

Comments
 (0)