Question: Everything seems to work on here except in bottom right where I put the # symbol. After the game is finished the 0 should end

Everything seems to work on here except in bottom right where I put the # symbol. After the game is finished the 0 should end the program and give the message "Thanks for playing! See you again soon!" but instead it asks for the player to select a pile again. Also on line 97 I have a line of code which should solve my problem where it says the computer removed a stone from pile 2 but it actually removed it from pile 1.

Everything seems to work on here except in bottom right where Iput the # symbol. After the game is finished the 0 should

15 start_str input("Would you like to play? (0 no, 1-yes) " 16 start int- int(start str) 17 if start int:-0: 18 print"Thanks for playing! See you again soon!") 19 pile one-int(5) 20 pile two-int(5) 21 score ply-int (8) 22 score-compaint(0) 23 if start_int 1 or start intc9: 24 start strinput( "Would you like to play? ( no, 1yes) ") 25 tart int int(start str) 26 while start_int1: 27 printl"Start-Pile 1: 5 Pile 2: 5") 28 ile pile one-0 and pile twoz 0: 29 Name Type pile int int pileone int pile str str pile two int score_comp int score ply int start int int start str Value exit pile str-input("Choose a pile (1 or 2):) pile intintpile str) if pileint2: File explorer print("Pile must be 1 or 2 and non-empty. Please try again." pile str- input("Choose a pile 1 or 2): " pile int- int pile str) 37 Python consale Console 1/A if pile-ints=1 : 41 42 43 stone str input"Choose stones to renove from pile:) stone_nume int(stone str) if pile_one-stone nunc: Computer -> Remove 1 stones fron pile 1 Pile 1 : 3 Pile 2 : 0 print("Pile must be 1 or 2 and non-empty. Please try again." stone stra input("Choose stones to remove from pile: ") stone num intlstone str Choose a pile ( or 21: 1 45 46 47 48 Choose stones to remove from pile: 1 Ptayer -Remove 1 stones fron pile 1 Pile 1: 2 Pile 2: Computer -Renove 1 stones tron pile 2 Pile 1 : 1 Pile 2 : 0 if stone nuP3: print("Stones must be 1 to 3. Please try again.") stone-str= input ("Choose stones to remove from pile: ") stonenum= int(stonestr) - - elif stone nun2: File explorer print("Pile must be 1 or 2 and non-empty. Please try again." pile str- input("Choose a pile 1 or 2): " pile int- int pile str) 37 Python consale Console 1/A if pile-ints=1 : 41 42 43 stone str input"Choose stones to renove from pile:) stone_nume int(stone str) if pile_one-stone nunc: Computer -> Remove 1 stones fron pile 1 Pile 1 : 3 Pile 2 : 0 print("Pile must be 1 or 2 and non-empty. Please try again." stone stra input("Choose stones to remove from pile: ") stone num intlstone str Choose a pile ( or 21: 1 45 46 47 48 Choose stones to remove from pile: 1 Ptayer -Remove 1 stones fron pile 1 Pile 1: 2 Pile 2: Computer -Renove 1 stones tron pile 2 Pile 1 : 1 Pile 2 : 0 if stone nuP3: print("Stones must be 1 to 3. Please try again.") stone-str= input ("Choose stones to remove from pile: ") stonenum= int(stonestr) - - elif stone nun

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!