1list = ["Python", "Java", "C++", "Javascript", "SQL", "PHP"]
2print(list[-1]) # "PHP"
3print(list[-4]) # "C++"
4print(list[:-3]) # ["Python", "Java", "C++"]
5print(list[-2:]) # ["Javascript", "SQL", "PHP"]
6print(list[-5:-2]) # ["Java", "C++", "Javascript"]
1thislist = ["apple", "banana", "cherry", "orange", "kiwi", "melon", "mango"]
2print(thislist[-2:])
3
4# ["melon","mango"]