Skip to content

Instantly share code, notes, and snippets.

@ashutoshpipriye
Created May 27, 2020 07:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ashutoshpipriye/1e26c1cd90c955ecbac59ac47b25fd0d to your computer and use it in GitHub Desktop.
Save ashutoshpipriye/1e26c1cd90c955ecbac59ac47b25fd0d to your computer and use it in GitHub Desktop.
# Write a program that extracts the last three items in the list sports and assigns it to the variable last.
# Make sure to write your code so that it works no matter how many items are in the list.
sports = ['cricket', 'football', 'volleyball', 'baseball', 'softball', 'track and field', 'curling', 'ping pong', 'hockey']
last = sports[-3:]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment