last two elements of list python code example
Example 1: python print last 3
message = iloveyouchina
#get last x words
#for example x = 3
print(message[-3:]
Example 2: list inside a list in python
# it appends a list into a list
list1 = [1,2,3,4,5]
list1.append([6,7])
# ouput = [1, 2, 3, 4, 5, [6, 7]]