samedi 11 avril 2020

Returning multiple values from function needed to be same value to do operation with it

      bingoT = set(1,4,3,2,1,2,4,5)

##Add more number to bigoT set() if not 24
    if(len(bingoT) != 24):
        while len(bingoT) < 24:
            bingoT.add(random.choice(range(1,75)))
    if(len(bingoT) > 24):
        while len(bingoT) > 24:
            bingoT.remove(random.sample(bingoT, 1)[0])  ##Remove random number from a secon user ticket\

    ##Intersect with set(&) func for wining numbers in draw and curent bingo ticket numbers
    winNumbrs = (newDraw()[0] & bingoT)
    #winNumbrs = dict(zip({n: n for n in range(1,25)}, {num: num for num in winNumbrs}))
    #print('win win type is: ',winNumbrs)
#print(drawNumbers & bingoT) ##Return matched numbers in two set()
    matchedNums = bingoT & winNumbrs
    return bingoT, winNumbrs, matchedNums

bingoT numbers {1, 3, 5, 7, 11, 13, 18, 21, 23, 25, 39, 41, 43, 46, 51, 53, 59, 62, 64, 67, 69, 70, 72, 73} {64, 1, 33, 47, 48, 49, 23, 59, 28} <- this is matched numbers and wining numbers -> {33, 3, 5, 73, 11, 43, 46, 61, 52, 53, 28, 29}

My question is how is not the same values some numbers missing from bingoT. Everything is in one function and must be same numbers for all of them. I call them in Object class like a attribute.Thank you.




Aucun commentaire:

Enregistrer un commentaire