Press a number on the speaker and it plays that track of the playlist, counting from 1. Write song_at(playlist, n) to return the title of track n; if the playlist is not that long, return None. n is at least 1.
song_at(["Intro", "Rain", "Home"], 2)→'Rain'song_at(["Intro"], 3)→Nonedef song_at(playlist, n):
try:
# your code here: return track n (lists count from 0)
pass
except IndexError:
return None
Run tries the examples. When they look right, Submit.