Posts

Game guesses the number.

print ( "ToyajKumar Game \n " )     #numbet = 15 number_of_quesses = 1 print ( "Number of guesses is limited to only 9 time \n " ) while ( number_of_quesses <= 10 ):     add = int ( input ( "Guess the number :- \n " ))     if add < 15 :         print ( "You enrte less number please input greater number. \n " )     elif add > 15 :         print ( "you enter greater number please input smaller number. \n " )     else :         print ( "Grate you won \n " )         prinr( 10 -number_of_guesses, "no. of guesses he took to finish." )         break     print ( number_of_quesses , "no. of guesses left" )     number_of_quesses = number_of_quesses + 1 if ( number_of_quesses > 10 ):     print ( "Game Over " )

Game rock, paper, scissor in python

 #Game rock, paper, scissor in python print( "Game By Toyajkumar \n" ) play_time = 1 Equal = 0 Lose = 0 Won = 0 while (play_time <= 5 ):     import random     list = [ "rock" , "paper" , "scissors" ]     choice = random.choice(list)     print( "Choice any one\n1 for rock\n2 for paper\n3 for scissors" )     you = int(input( ":- " ))     if you == 1 :         if choice == "rock" :             print( "Equal" )             Equal += 1         elif choice == "paper" :             print( "Lose" )             Lose += 1         elif choice == "scissors" :             print( "Won" )             Won += 1     if you == 2 :         if choice == "rock" :  ...

How to find odd and even number by using Python?

Image
  #How to find odd and even number by using Python? #Find Even and Odd number Between (1 to 10) #Find Even Number count= 0 print( "Even number" ) for number in range( 1 , 10 ):     if number % 2 == 1 :         count+= 1         print(number) print( f "total even number is {count} " ) #Find Odd Number count= 0 print( "Odd number" ) for number in range( 1 , 10 ):     if number % 2 == 0 :         count+= 1         print(number) print( f "total odd number is {count} " ) #After reading the code.

Basic calculator.

Image
Basic calculator . By Tryadav  def calculator(): print (("Calculator By Toyaj yadav\n")) print (("please choose one of the following options ( + , - , / , * )\n")) A = input ("Enter :- ") B = input ("number 1 :-  ") C = input ("number 2 :-  ") if A == "+": ans=(float(B)+float(C)) print((str(B)+(A)+(C)+(" = "))+(str(ans))) elif A == "-": ans=(float(B)-float(C)) print((str(B)+(A)+(C)+(" = "))+(str(ans))) elif A == "*": ans=(float(B)*float(C)) print((str(B)+(A)+(C)+(" = "))+(str(ans))) elif A == "/": ans=(float(B)//float(C)) print((str(B)+(A)+(C)+(" = "))+(str(ans)))  elif A: print(("SAMETHING IS WRONG !!!!!\n")) again() def again():     Z=input("Do you want to calculate again? Please type y for YES or x for No \n Enter :- ")     if Z== "y":         calculator()     elif Z== "...