narenarya

odd list returning python program

Apr 8th, 2014
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.22 KB | None | 0 0
  1. def is_even(n):
  2.     return n%2==0
  3. def list_odd(odd_list):
  4.     res=[]
  5.     for i in odd_list:
  6.         if not is_even(i):res.append(i)
  7.     print res
  8.     return res
  9. list_odd([1,24,7,34,8])
  10. m=[1,65,4,3,72]
  11. list_odd(m)
Advertisement
Add Comment
Please, Sign In to add comment