Skip to content

Rather than hard-coding the index for the last student #1

@KhalilKhunji

Description

@KhalilKhunji

last_student = students[2]

You want to access the list based on the assumption that you do not know its length, and thus are unaware of which index the last student is at. Thus:

last_student = students[-1] 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions