import random

for game in range(5):
    lotto = []
    
    # 6개의 서로 다른 번호를 뽑는 반복문
    while len(lotto) < 6:
        rnd_num = random.randint(1, 45)
        # 중복되지 않은 번호일 때만 리스트에 추가
        if rnd_num not in lotto:
            lotto.append(rnd_num)
            
    lotto.sort()
    print("{}번째 로또번호: {}".format(game + 1, lotto))

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: