How to get the second to last element of a tuple in Python

1 Answer

0 votes
tpl = (14, 69, 71, 88, 97, 96)
 
second_to_last = tpl[-2]
 
print(second_to_last) 
  
  
  
  
'''
run:
  
97
  
'''

 



answered Jul 25, 2022 by avibootz
...