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)
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)
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
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)
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)
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)
T'hanks sir
Thanks you dear jaspreet sing sir from Pakistan and long live for jaspreet sing sir from 🇵🇰🇵🇰❤❤
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
Is course is completed or not?
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)