undefined

PHOTO EMBED

Fri Mar 29 2024 21:12:39 GMT+0000 (Coordinated Universal Time)

Saved by @wiseteacher

import random

correct_answer = random.randint(1, 10)
guess = 0

while guess != correct_answer:
    guess = int(input("Gissa ett tal mellan 1 och 10: "))

    if guess == correct_answer:
        print("Correct!")
    else:
        print("Wrong :(")
content_copyCOPY

https://www.mathplanet.com/education/programming/logic-and-choice/simple-repetition