0
Good evening, I’m trying to make a 5x5 bingo card, using Andom to generate the values, however there can be no equal numbers. I tried to do it that way but it still comes up equal numbers:
import random as rd
cart1 = []
for i in range(0, 5):
    cart1.append([])
for l in range(0, 5):
    for c in range(0, 5):
        var = rd.randint(0, 99)
        if var not in cart1:
            cart1[l].append(var)
print("\n")
print("A cartela 1 é:")
for l in range(0, 5):
    for c in range(0, 5):
        print(f"[{cart1[l][c]:^5}]", end="")
    print()
One of the results:
Thanks for the tip!
– Matheus Souza