1. 41.Py

    n=2992
    def py(n,m):
        total = 0
        while n>0:
            total+=n%m
            n=n/m
        return total
    print py(n,10)==py(n,16)==py(n,12) and "Yes" or "No"
    
    read more
  2. 34.The password generated

    a = 1
    b = 77
    x = 1
    y = 14
    
    lister, ans, a = [], [], a%b*10
    while a not in lister:
        lister.append(a)        # 1. not includes x of x.123456
        ans.append(a // b)
        a = (a % b)*10
    
    nolooplen = lister.index(a) # when the iteration appears in ans
    looplen = len(ans ...
    read more

« Page 18 / 23 »

blogroll

social