Jak zdobyć ostatnie n elementy listy w Python
array = ["a", "b", "c", "d"]
num_elements = 3
print(array[-num_elements:])
panda
array = ["a", "b", "c", "d"]
num_elements = 3
print(array[-num_elements:])
some_list = [1, 2, 3]
some_list[-1]
print(some_list)
#Output = 3
message = iloveyouchina
#get last x words
#for example x = 3
print(message[-3:]
your_list = ["apple", "orange", "grapes"]
last_value = your_list[-1]
# Get the last element in a List
list = ["A", "B", "C"]
print(list[-1])