Question

In python: Create a list called numten that contains ten numbers go through the list and...

In python:

Create a list called numten that contains ten numbers go through the list and list the even and odd numbers

0 0
Add a comment Improve this question Transcribed image text
Answer #1

answer)

numten=[3,2,5,12,54,3,6,2,4,6]
evenlist=[]
oddlist=[]
for i in range (0,len(numten)):
if(numten[i]%2==0):
evenlist.append(numten[i])
else:
oddlist.append(numten[i])
if(len(evenlist)!=0):
print("Even numbers are ",evenlist)
if(len(oddlist)!=0):
print("Odd numbers are",oddlist)

output:

if numten=[2,4,6,2,12,4,8,10,98,100]

then output is :

Add a comment
Know the answer?
Add Answer to:
In python: Create a list called numten that contains ten numbers go through the list and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT