Python Python Sequences Sequence Operations Creating Slices

Why is this code incorrect

I don't know what my mistake is here.

slices.py
student_gpas = [4.0, 2.3, 3.5, 3.7, 3.9, 2.8, 1.5, 4.0]
sliced_gpas = student_gpas[2:7;]
Carter Pringle
Carter Pringle
3,188 Points

the semi-colon, it should be

sliced_gpas = student_gpas[2:7:]

1 Answer

Jassim Al-Hatem
Jassim Al-Hatem
19,543 Points

Change the 7 to 5. and get rid of the semi-colon.