Hello Programmers, Welcome to my channel.
In this video you will learn about how to Write a Python Program to Put Even And Odd Elements in a List Into Two Different Lists
Python Scripts
======================
https://codewithtj.blogspot.com/2024/...
Python Functions Solved
==========================
https://codewithtj.blogspot.com/2023/...
Python Programs Solved
============================
https://codewithtj.blogspot.com/2023/...
Code
=============================
length = int(input("Enter List Length : "))
numbers_list = []
for _ in range(length):
temp = int(input("Enter List Element : "))
numbers_list.append(temp)
even_list = [item for item in numbers_list if item % 2 == 0]
odd_list = [item for item in numbers_list if item % 2 != 0]
print("Even List is : ", even_list)
print("Odd List is : ", odd_list)
OUTPUT
==================Enter List Length : 10
Enter List Element : 34
Enter List Element : 45
Enter List Element : 23
Enter List Element : 21
Enter List Element : 9
Enter List Element : 78
Enter List Element : 85
Enter List Element : 44
Enter List Element : 55
Enter List Element : 78
Even List is : [34, 78, 44, 78]
Odd List is : [45, 23, 21, 9, 85, 55]
Keywords
=============================
#python #python3 #python_assignment #pythonprogramming #pythontutorial #pythonprojects #pythoncourse #pythonbaba #pythonforbeginners #pythonautomation #pythonbasic #pythonbeginners
On this page of the site you can watch the video online Write a Python Program to Put Even And Odd Elements in a List Into Two Different Lists with a duration of hours minute second in good quality, which was uploaded by the user Code With TJ 09 December 2022, share the link with friends and acquaintances, this video has already been watched 126 times on youtube and it was liked by 0 viewers. Enjoy your viewing!