Skip to content

Latest commit

 

History

History
15 lines (10 loc) · 311 Bytes

access_list_items.md

File metadata and controls

15 lines (10 loc) · 311 Bytes

Access List Items

Given the following list li = [2, 0 ,1, 7, 2, 0, 2, 2] perform the following:

  1. Print the first item of the list - print(li[0])
  2. Print the last item of the list - print(li[-1])

Bonus:

  1. Print random item of the list
from random import choice
print(choice(li))