len(function internally works like list __len__(or tuple __len__(thusnote that len(works only on objects that has __len__(method set { set __len__( howeverin practicewe prefer len(instead of the __len__(function because of the following reasonsit is more efficient and it is not necessary that particular method is written to refuse access to special methods such as __len__ it is easy to maintain it supports backward compatibility reversed(seqit returns the reverse iterator seq must be an object which has __reversed__(method or supports the sequence protocol (the __len__(method and the __getitem__(methodit is generally used in for loops when we want to loop over items from back to front normal_list [ class customsequence()def __len__(self)return def __getitem__(self,index)return " { }format(indexclass funkyback()def __reversed__(self)return 'backwards!for seq in normal_listcustomsequence()funkyback()print('\ {}format(seq __class__ __name__)end=""for item in reversed(seq)print(itemend=""the for loop at the end prints the reversed list of normal listand instances of the two custom sequences the output shows that reversed(works on all the three of thembut has very different results when we define __reversed__