{"id":25814,"date":"2021-12-16T09:18:30","date_gmt":"2021-12-16T03:48:30","guid":{"rendered":"https:\/\/python-programs.com\/?p=25814"},"modified":"2021-12-16T09:18:30","modified_gmt":"2021-12-16T03:48:30","slug":"python-program-for-collections-userlist","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-for-collections-userlist\/","title":{"rendered":"Python Program for collections.UserList"},"content":{"rendered":"

Python collections.UserList():<\/strong><\/p>\n

Python has a List-like container called UserList, which is found in the collections module. This class acts as a container for List objects. This class is useful when one wants to create their own list with modified or new functionality. It can be viewed as a method of adding new behaviors to the list. This class takes a list instance as an argument and simulates a regular list. The data attribute of this class provides access to the list.<\/p>\n

Syntax:<\/strong><\/p>\n

collections.UserList(list)<\/pre>\n

Parameters:<\/strong><\/p>\n

list:<\/strong> This is required. It is a list to be given as input.<\/p>\n

Program for collections.UserList in Python<\/h2>\n