Question & Answer: eter a list of strings and returns a list containing each string twice……

Write the code in PYTHON 3.

Question 40 5 pts Write a function double that takes as a parameter a list of strings and returns a list containing each string twice.

Write a function double that takes as a parameter a list of strings and returns a list containing each string twice.

Expert Answer

 

In the following Python program we use a double() function that takes in a list of strings as parameter and duplicates each string in the list. It does so by using the extend function.

CODE :

Output:

Still stressed from student homework?
Get quality assistance from academic writers!