Q. Write a Python program to append a list to the second list.

 

Answer =

lst1 = eval(input("Enter Frist list :-"))
lst2 = eval(input("Enter Second list :-"))
lst1 += lst2

print(lst1)

Output :-

Enter Frist list :-[ 1,2,3,4]
Enter Second list :-[5,6,7,8,9]
[1, 2, 3, 4, 5, 6, 7, 8, 9]

>>> 


Enter Frist list :-["Path", "Walla", "Portal", ""]
Enter Second list :-["Express", "Python"]
['Path', 'Walla', 'Portal', '', 'Express', 'Python']

>>> 

4 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

  1. this is not working. showing "tuple not attributed to append"

    ReplyDelete
    Replies
    1. I think you have input Tuple but question want that user must enter List.

      Delete
  2. Where is output

    ReplyDelete

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post