Jan-14-2018, 09:21 PM
So i've been trying to figure out what is wrong here but i think that i dont have enough experience in python yet.
Can anyone point out my mistake here?
Thanks
Can anyone point out my mistake here?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
def main(): choice = input ( "Pick one: 1)Rock 2)Paper 3)Scissors | Answer: " ) if (choice = = "1" ): print ( ">You chose rock!<" ) if (choice = = "2" ): print ( ">You chose paper!<" ) if (choice = = "3" ): print ( ">You chose scissors!<" ) answer () def mid(): import time time.sleep( 2 ) import random botc = random.randint( 1 , 3 ) def answer(): if (botc = = "1" and choice = = "1" ): print ( "Picked Rock!Tie!" ) if (botc = = "2" and choice = = "2" ): print ( "Picked Paper!Tie!" ) if (botc = = "3" and choice = = "3" ): print ( "Picked scissors!Tie!" ) if (botc = = "1" and choice = = "2" ): print ( "Picked rock!You win!" ) if (botc = = "1" and choice = = "3" ): print ( "Picked rock!You lost!" ) if (botc = = "2" and choice = = "1" ): print ( "Picked paper!You lose!" ) if (botc = = "2" and choice = = "3" ): print ( "Picked paper!You win!" ) if (botc = = "3" and choice = = "1" ): print ( "Picked scissors!You win!" ) if (botc = = "3" and choice = = "2" ): print ( "Picked scissors!You win!" ) mid() main() |