#given a list
list_unsorted = [4,2,65,999,23,765,29,45,12,0]
#sort list
list_sorted = sorted(list_unsorted)

#print values [0] and [-1]
print("First element:",list_sorted[0],"Last element:",list_sorted[-1])