Python Special Programs - Separating Even & Odd Numbers

preview_player
Показать описание
Python Programming: Python Special Programs - Separating Even & Odd Numbers
Topics discussed:
1. Python Program to separate Even and Odd Numbers from a list of numbers.

Music:
Axol x Alex Skrindo - You [NCS Release]

#PythonByNeso #PythonProgramming #PythonPrograms
Рекомендации по теме
Комментарии
Автор

We code this without append 😊😊😊😊
n=list(map(int, input('enter a number = ').split()))
even=[]
odd=[]
for val in n:
if val%2==0:
even=even+[val]
else:
odd=odd+[val]
print(even)
print(odd)

IQplus
Автор

Thanks you dear jaspreet sing sir from Pakistan and long live for jaspreet sing sir from 🇵🇰🇵🇰❤❤

UsmanAliAli-odeg
Автор

real = []
print ('Enter some numbers in the list: (press "-1" to exit)')
while True:
x = int(input())
if x == -1:
break
real.append(x)

even_nums = []
odd_nums = []

for num in real:
if num % 2 == 0:
even_nums.append(num)
else:
odd_nums.append(num)

print ('Even Numbers: ')
print (even_nums)

print ('Odd Numbers: ')
print (odd_nums)

tayyab.sheikh
Автор

Sir, could you please teach the my sql its a request. I searched many websites but not satisfied can't able to get the content up to the mark .So I heard about you that the way you teach is very excellent and can able to content in a good way . So its a request to teach the my sql

PeddammaSrilatha
Автор

li = list(range(1, 25))
evenNumbers = []
oddNumbers = []

for i in li:
if i % 2 == 0:
evenNumbers.append(i)
else:
oddNumbers.append(i)
print(evenNumbers)
print()
print(oddNumbers)

walida
welcome to shbcf.ru