Medium
Playlist Player
Write
class Player holding a list of songs and a current position, with next() and prev() that wrap around and current(). Read songs, then a line of commands (n or p); print the current song after each command.Input
Songs, then commands.
Output
One line per command.
Sample 1
Input
a b c n n n p
Output
b c a c
Sample 2
Input
solo n p
Output
solo solo
Output appears here