1 comment:

  1. def decimal(a,t):
    for i in range(0,t):
    k=0
    p=0
    while a[i]>0:
    r=a[i]%10
    p=p+pow(2,k)*r
    a[i]=a[i]/10
    k=k+1
    a[i]=p
    return a
    mylist=[1001,1111,1100,1010]
    print mylist
    s=len(mylist)
    decimal(mylist,s)
    print mylist
    [1001, 1111, 1100, 1010]
    [9, 15, 12, 10]

    ReplyDelete