Find Secret number - python game

 

for num in range(1):
    print("In this game has a hidden secret number")
    print("so your target is find this secret number")
    print("'you have total moves 9'")
    break
num=0
while num<9:
    num =num+1
    num1=int(input("Enter number: "))
    print("                                                                                      No. of moves left:",num)
    if num1<18:
        print("your number is smaller")
        print("choose big number")

    elif num1>18:
        print("your number is greater")
        print("choose small number")

    elif num1>30:
        print("you number too big")
        print("choose small number")

    elif num1<10:
        print("your number is too small")
        print("choose big number")

    elif num1==18:
        print("congrats!!","your number is correct")
        print("you won, this game only",num,"moves")
        break
    else:
        print("no. of enough moves")
        print("Try again")

    if num==9:
         print("no. of enough moves")
         print("game over!!")
         print("the secret number was 18")
         break
         
       
       
       
       

   
       
 
   

Comments

Popular posts from this blog

Become Healthy Goal - Python Program

Calculator in C++

Interpretation vs Compilation