[ create a new paste ] login | about

Link: http://codepad.org/bdfeGxRo    [ raw code | fork ]

Python, pasted on Aug 14:
1
2
3
4
5
6
7
8
9
10
11
12
13
import random

pick_new_number = random.choice

def gen_divisible_number():
    result = 0
    for divisor in range(1, 11):
        possible_new = filter(lambda x: x % divisor == 0,
                             map(lambda (a,b): a + b,
                                 zip([result * 10] * 10,
                                     range(0, 10))))
        result = pick_new_number(possible_new)
    return result


Output:
No errors or program output.


Create a new paste based on this one


Comments: