Posted By

brm on 01/03/16


Tagged

problem solving


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

brm


Found the "11"


 / Published in: Python
 

Return list of number contain "11" from input number

  1. #!/usr/bin/python
  2.  
  3. def findit(n):
  4. return[i for i in xrange(n+1) if '11' in str(i)]
  5.  
  6. nums = input("number: ")
  7. result = findit(nums)
  8. print result
  9. print len(result)

Report this snippet  

You need to login to post a comment.