Python List clear() & copy() Method

Python List clear() Method

  • The clear() method removes all items from the list. 

Syntax

  • list.clear()

Parameter Values

  • The clear() method doesn't take any parameters.

Python List copy() Method

  • The copy() method returns a shallow copy of the list.

Syntax

  • list.copy()  

Parameter Values

  • The copy() method doesn't take any parameters.

 

 

 

 


 

 

 

 

 

 

Comments