Chrome Extension

Get last item or value from a List in python

The code snippet example can be used to get the last element from the list using python programming language.
subjects = ["Math", "Physics", "Chemistry", "English"]

last_item = subjects[-1]
print(last_item)

# prints - English
Best JSON Validator, JSON Tree Viewer, JSON Beautifier at same place. Check how cool is the tool
Output
English

Search Index Data (The code snippet can also be found with below search text)

last item of array python
Was this helpful?
0 Comments