def main():
    prolog = Prolog()
    prolog.consult("coins.pl")
    count = int(raw_input("How many coins (default: 100)? ") or 100)
    total = int(raw_input("What should be the total (default: 500)? ") or 500)
    coins = Functor("coins", 3)
    S = Variable()
    q = Query(coins(S, count, total))
    i = 0
    while q.nextSolution():
        ## [1,5,10,50,100]
        s = zip(S.value, [1, 5, 10, 50, 100])
        print i,
        for c, v in s:
            print (c,v) % "%dx%d",
        print
        i += 1
    q.closeQuery()
dataset/ETHPy150Open yuce/pyswip/examples/coins/coins_new.py/main/swapped operands of `%`