Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def my_mp3_playlist(file_path):
- file_input = open(file_path, "r")
- longest_song = ""
- artist = ""
- new_list = []
- counter = 0
- new_list = list()
- for line in file_input:
- counter += 1
- line = line.split(";")
- if line[2] > longest_song:
- longest_song = line[2]
- if line[1] not in new_list:
- new_list.append(line[1])
- if line[1] in new_list:
- artist = line[1]
- file_input.close()
- file_input = open(file_path, "r")
- for line in file_input:
- line = line.split(";")
- if longest_song in line:
- longest_song = line[0]
- file_input.close()
- return (longest_song, counter, artist)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement