social app,Letest app,Video editing app you are easily find and download on this website

تازہ ترین پوسٹ

Post Top Ad

Your Ad Spot

Saturday, July 1, 2023

import random def play_game(): target_number = random.randint(1, 100) attempts = 0 print("Welcome to the Number Guessing Game!") print("I'm thinking of a number between 1 and 100.") while True: guess = int(input("Take a guess: ")) attempts += 1 if guess < target_number: print("Too low! Try a higher number.") elif guess > target_number: print("Too high! Try a lower number.") else: print(f"Congratulations! You guessed the number in {attempts} attempts.") break play_game()

No comments:

Post a Comment

Post Top Ad

Your Ad Spot

???????