YouTip LogoYouTip

Python3 Att List Copy

# Python3.x Python3 List copy() Method [![Image 3: Python3 Lists](#) Python3 Lists](#) * * * ## Description The copy() function is used to copy a list, similar to **a[:]**. ## Syntax The syntax for the copy() method is: list.copy() ## Parameters * None. ## Return Value Returns a new copied list. ## Example The following example demonstrates the usage of the copy() function: ## Example #!/usr/bin/python3 list1 =['Google','','Taobao','Baidu'] list2 = list1.copy() print("list2 list: ", list2) The output of the above example is as follows: list2 list: ['Google', '', 'Taobao', 'Baidu'] [![Image 4: Python3 Lists](#) Python3 Lists](#)
← Java Arraylist SortJava Arraylist Sublist β†’