सूची में पायथन अंतिम तत्व
# To get the last element in a list you use -1 as position
bikes = ['trek', 'redline', 'giant']
bikes[-1]
# Output:
# 'giant'
सरणी पायथन का अंतिम तत्व प्राप्त करें
some_list[-1]
पायथन को सूची का अंतिम तत्व मिलता है
number_list = [1, 2, 3]
print(number_list[-1]) #Gives 3
number_list[-1] = 5 # Set the last element
print(number_list[-1]) #Gives 5
number_list[-2] = 3 # Set the second to last element
number_list
[1, 3, 5]
पायथन को सूची में अंतिम तत्व मिलता है
l = [1, 2, 3]
l[-1]