2021-04-20 20:17:14 +00:00

8 lines
485 B
Python

animals = ["Bear", "Tiger", "Penguin", "Zebra", "Elephant", "Hippo"]
bear = animals[0]
#different ways to print items from a list
print(f"the list animals[0] is {animals[0]}, but the variable bear is {bear}")
print(f"The animal 1: {animals[1]}\nThe third animal: {animals[2]}\nThe first animal: {animals[0]}")
print(f"The animal at 3: {animals[3]}\nThe fifth animal: {animals[4]}\nThe animal at 2: {animals[2]}")
print(f"The sixth animal: {animals[5]}\nThe animal at 4: {animals[4]}")