I am basically writing a code to take a list as an input and output the last item of the user given list items. This is the entire code:
input_list = [1, 2, 3, 4, 5, 6]
list_Length = int(input())
for i in range(list_Length):
user_input = input()
input_list.append(user_input)
last_Before = list_Length - 2
print(last_Before)
print(input_list[: last_Before: -1])
My question is, instead of writing print(input_list[: last_Before: -1])
at the last line, if I write print(input_list[0: last_Before: -1])
, it gives me an empty string. WHY??!?!