Seat Numbers Start at One

Python FundamentalsMedium+10 XP+10

Seat Numbers Start at One

At a cinema, the seats in a row are numbered 1, 2, 3, ... from the left. The program keeps the names of who's sitting in a row as a list.

Task: write who_is_in_seat(row, seat_number) that returns the name in that seat.

  • seat_number is always between 1 and the number of seats in the row.

Examples

row = ["Ana", "Ben", "Cy", "Dee"]
seat_number = 1
returns 'Ana'
row = ["Ana", "Ben", "Cy", "Dee"]
seat_number = 3
returns 'Cy'

Hints

Solve it to unlock the solution

Once your code passes every test, a reference solution shows up here so you can compare it with yours.

solution.py
CtrlEnterto run