← 2023 questions

2023 / SPOTIFY / QUESTION 12

Music player interface

Try the question in your own editor, then check your output below.

THE QUESTION

Make a list of songs which can be cycled through with an interface using tkinter. Use the slider to show a bar that shows the progress of the song over time. Also, include a slider to change the volume. (You don’t need to actually play the song)

Start Code:

import tkinter as tk

Question by Dhivyesh. Source: Girls In Code SEA — Behind the Screens, 2023, slide 27.

PRACTICE CHECK

Try your answer.

New state-tracing checkpoint. The graphical interface itself requires manual review.

Run your program in your own editor, then paste its output below. This checks the stated output or checkpoint; it does not assess your full program. Practice attempts do not affect competition scores.

Practice state: songs [Song A, Song B, Song C], current index 0. Press Next once, set progress to 45 seconds and volume to 70. Enter the current title, progress and volume in that order.

Reveal worked answer

Player state

Song B
45
70

Next advances the index to 1 (Song B). The slider values are 45 seconds and 70.