2. The loop should continue until the user guesses correctly.
3. Once the user has guessed the number, print how many tries it took.
Right Answer:
number = 6
attempts = 0
while attempts < 3:
guess = int(input("Guess a number between 1 and 10: "))
if guess == number:
print("Congratulations! You guessed correctly!")
break
attempts += 1
if attempts == 3:
print("Sorry, you've run out of attempts. Better luck next time!")