filmov
tv
Learn how to separate even and odd numbers from a list using Python.#shorts #coding #python #study

Показать описание
Learn how to separate even and odd numbers from a list using Python.
Python Code:
# Check the even number in list
num = [1,2,3,4,5,6,7,8,9,10]
print("The even number is :")
for i in num:
if i % 2 == 0:
print(i)
print("The odd number is ")
for j in num:
if j % 2 != 0:
print(j)
Concepts Used:
- List in Python
- For Loop
- Modulo Operator (%)
Great for Python beginners!
💡 Follow for daily Python coding tips
🔔 Subscribe now 👉 @codewithme03
#Python #EvenOdd #PythonShorts #LearnPython #CodeWithMe03 #PythonBeginner
Python Code:
# Check the even number in list
num = [1,2,3,4,5,6,7,8,9,10]
print("The even number is :")
for i in num:
if i % 2 == 0:
print(i)
print("The odd number is ")
for j in num:
if j % 2 != 0:
print(j)
Concepts Used:
- List in Python
- For Loop
- Modulo Operator (%)
Great for Python beginners!
💡 Follow for daily Python coding tips
🔔 Subscribe now 👉 @codewithme03
#Python #EvenOdd #PythonShorts #LearnPython #CodeWithMe03 #PythonBeginner