149k views
1 vote
If the start index is __________ the end index, the slicing expression will return an empty string.

User Azt
by
5.1k points

1 Answer

5 votes

Answer:

"Greater than."

Step-by-step explanation:

The designated end of a string cannot be reached from the start. For example, if you had a list labeled 'colors' (colors = [1,2,3,4]) and then you tried to bring back that list using colors[1:0], you will recieve an empty string. However, if the starting is lower than the final index, then your program will run. For example, if you use colors[0:1], you will be given the output: [1].

User Paul Jurczak
by
4.7k points