Write a short code to print the first 5 elements of a given list.
[1, 2, 3, 4, 5, 6, 7, 8]
Here is a short Python code that can do that:

my_list = [1, 2, 3, 4, 5, 6, 7, 8]
for i in range(5):
    print(my_list[i])
Complete the following task based on the instruction and optional input provided.### Instruction:
Write a short code to print the first 5 elements of a given list.

### Input:
[1, 2, 3, 4, 5, 6, 7, 8]

### Output:
Here is a short Python code that can do that:

my_list = [1, 2, 3, 4, 5, 6, 7, 8]
for i in range(5):
    print(my_list[i])