Python novice

Asked 2 years ago, Updated 2 years ago, 17 views

from random import shuffle
from time import sleep

gamenum = input ('Please enter the number of Lotto games:')

for i in range(int(gamenum)):
    balls = [x+1 for x in range(45)]
    rat = []
    for j in range(6):
        shuffle(balls)
        unmber = balls.pop()
        ret.append(number)
    ret.sort()
    print('Lotto number[%d]:'%(i+1), end=")
    print(ret)
    sleep(1)

If you keep running, you'll get an error I typed it exactly as it was in the example How do I fix the error?

python

2022-09-22 14:18

1 Answers

print('lotto number[%d]:'%(i+1), end=") instead of print('lotto number[%d]:'%(i+1), end="")

Quotation not included in end=".


2022-09-22 14:18

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.