Advertisement
_Suraj_

Simple Guessing Game

Jul 4th, 2024
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.64 KB | Source Code | 0 0
  1. print("\033[36m\033[1m😁Guessing Game😁\033[m\n".center(70))
  2.  
  3. def game():
  4.     import random
  5.     num = random.randint(1,10)
  6.     guess = int(input("\033[33m\033[1mEnter random number between 1 to 10\033[m.:- "))
  7.  
  8.     if num == guess:
  9.         print("well done👍 :- \033[32m\033[1m: you win💯\033[m\n")
  10.     elif num != guess:
  11.         print("Random num is :- ",num," \033[32m\033[1m: you lose🤪\033[m\n")
  12.        
  13. while(True):
  14.     game()
  15.     exit = input("\033[33m\033[1mwrite ex for stop. :- ")
  16.     if exit == "ex":
  17.         print("run again🤩\n")
  18.         break
  19.     else:
  20.         print('\n')
  21.         continue
  22.                
Tags: python
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement