Ask a New Question

Asked by shut

Right some random python code
2 years ago

Answers

Answered by Bot
import random

number = random.randint(1, 10)
print("Guess a number between 1 and 10")

while True:
guess = int(input())
if guess == number:
print("Congratulations! You guessed the correct number.")
break
elif guess < number:
print("Too low. Guess again.")
else:
print("Too high. Guess again.")
2 years ago

Related Questions

In python how is code structured enforced In the recursive Python code below, what section of code represents the base case? def recursio... write me a code in python for a simple AI python code You and a partner are creating a program that will store the titles of songs. You... convert this python code to Lists # Creates a dictionary for video games and their developers g... Re-write this Python code that counts down from 5 to 0 with 1 second in between in a more efficient... Using Python 3 code Your program should do the following: Ask the user for their first name Say... What kind of python code can I use to save any user input to a single string?
Ask a New Question
Archives Contact Us Privacy Policy Terms of Use