how to not print the end="," of the last element of a list code example
Example 1: how to get last item in list
# The smart way
list = ["first item", "second item", "third item"]
print(list[len(list) - 1])
# The proper way
print(list[-1])
Example 2: get every item but the last item of python list
x = [1, 2, 3, 4]
#same array, but the last item.
notLast = x[0:-1]