Skip to content

Instantly share code, notes, and snippets.

@dilanshah
Created February 27, 2018 22:37
Show Gist options
  • Save dilanshah/ae049599e2ca2e0841c59dd2b0d0d631 to your computer and use it in GitHub Desktop.
Save dilanshah/ae049599e2ca2e0841c59dd2b0d0d631 to your computer and use it in GitHub Desktop.
Given an integer number, write a function that returns true if there are any odd digits in the number; e.g. 2468 -> false, 2478 -> true
'''
"Given an integer number, write a function
that returns true if there are any odd digits in the
number; e.g. 2468 -> false, 2478 -> true"
'''
class Solution():
def containsOdd(self,n):
return any([int(x)%2 for x in list(str(n))])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment