Close
Close

for loop problem

   wei123

odd = []
even = []
for i in range(1, 101):
    if i % 2 == 0:
        even.append(i)
        print("the even no:", even)
    else:
        odd.append(i)
        print("the odd no:", odd)

From the two list obtained in previous question, make new lists, containing only numbers which are divisible by 4, 6, 8, 10, 3, 5, 7 and 9 in separate lists.


Answers

Ask Yours
Post Yours
Write your answer