Even Odd Counter in list Program in Python

Even Odd Counter in list Program in 
Python


Code:

mylist=[0 for i in range(3)]
for i in range(3):
    mylist[i]=int(input("please enter elecments"))
    e=0
    o=0
for i in range(3):
    if(mylist[i]%2==0):
        e=e+1
    else:
        o=o+1
print("the total even number : ",e)
print("the total odd number : ",o)







Output:


please enter elecments1
please enter elecments2
please enter elecments3
the total even number :  1
the total odd number :  2
>>> 

Video Tutorial:




Post a Comment

Previous Post Next Post