Embed presentation
Download to read offline






































































This Python code generates a random number from 1 to 10, gives the user 3 attempts to guess it, and tells them if they win or lose. It prompts the user for a guess, checks if it matches the random number, subtracts 1 from the number of guesses left if it's wrong, and breaks out of the loop if correct, otherwise it tells the user they lose after exhausting their guesses.





































































