(Solved):Given that plist1 and plist2 both refer to lists, write a Python statement that defines plist3 as a new list that is the concatenation of plist1 and plist2. Do not modify plist1 or plist2. View Answer…

 

Question

Given that plist1 and plist2 both refer to lists, write a Python statement that defines plist3 as a new list that is the concatenation of plist1 and plist2. Do not modify plist1 or plist2.

 

EXPERT ANSWER

There are 2 ways to concatenate lists in Python:

1. using the ‘+’ operator, and

plist3=plist1+plist2

2. using the extend operator

plist3=plist1.extend(plist2)

We are so grateful for the pleasure of serving you and hope we met your expectations. Thank

Scroll to top