Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
count(even/odd)fromlist.py
#python 3.5.2 #find number of odd and even numbers present in the list def count_even_odd(list): even=0 odd=0 for e in list: if e%2==0: even+=1 else : odd+=1 return even,odd list=[1,2,3,4,5,6,7,8,9,10] even,odd=count_even_odd(list) print('No of evens = ',even) print('No of odds = ',odd)
run
|
edit
|
history
|
help
0
haha
First python practice
Venture
sum of odd numbers
Skillenza - Marker Count
rstring
Email_Python
Removing adjacent duplicates from string
Distance between latititude and longitude
ok