Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To check if a 4th element exists, you just need to determine the size of the list. The following line will check to see if a 4th element exists:

len(fr) >= 4

Note that even if you delete an item from the middle of your list, the indexes of the items after it will be shifted so that there are no gaps in your list.