Write A Python Function To Append A List To The Second List

Write A Python Function To Append A List To The Second List

Code With TJ

54 года назад

312 Просмотров

Hello Programmers, Welcome to my channel.

In this video you will learn about how to Write A Python Function To Append A List To The Second List

Python Scripts
======================
https://codewithtj.blogspot.com/2024/01/python-script-list.html

Python Functions Solved
==========================
https://codewithtj.blogspot.com/2023/10/python-function-code-with-tj-page-1.html

Python Programs Solved
============================
https://codewithtj.blogspot.com/2023/09/python-programs.html



Code
=============================
def extend_list(first, second):
second.extend(first)


length = int(input("Enter First List Length : "))
list1 = []
for _ in range(length):
temp = int(input("Enter List1 Item : "))
list1.append(temp)

length = int(input("Enter Second List Length : "))
list2 = []
for _ in range(length):
temp = int(input("Enter List2 Item : "))
list2.append(temp)

extend_list(list1, list2)
print("The contents of second list is : ", list2)


Keywords
=============================
#python #python3 #python_assignment #pythonprogramming #pythontutorial #pythonprojects #pythoncourse #pythonbaba #pythonforbeginners #pythonautomation #pythonbasic #pythonbeginners
Ссылки и html тэги не поддерживаются


Комментарии: