0

Why my program doesnt work properly in this app?

#Enjoy the rock,paper and scissor game. import random choice = ['rock', 'paper', 'scissor'] chances = 5 print("Hello! Welcome to rock paper and scissor game.") player_won = 0 computer_wons = 0 while chances > 0: chances -= 1 computer_choice = random.choice(choice) player_pick = input("Enter [rock/paper/scissor]: ").lower() if player_pick == 'rock' or player_pick == 'scissor' or player_pick == 'paper': if computer_choice == 'rock': if player_pick == 'paper': print("Congrats! You won. Computer picked ", computer_choice) player_won += 1 continue elif player_pick == 'rock': print("Its a tie. Nobody wins. Computer also picked Rock!") continue else: print("Sorry you lost! Computer picked rock..") computer_wons += 1 continue elif computer_choice == 'paper': if player_pick == 'rock': print("Sorry you lost! Computer picked rock..") computer_wons += 1 continue elif player_pick == 'paper': print("Its a tie. Nobody wins. Computer also picked Paper!") continue else: print("Congrats! you won. Computer picked paper.") player_won += 1 continue elif computer_choice == 'scissor': if player_pick == 'scissor': print("Umm its a tie. Computer also picked scissor!") continue elif player_pick == 'rock': print("Congrats you won! Computer just picked scissor. ") player_won += 1 continue else: print("Sorry! you loose. Computer picked scissor.") computer_wons += 1 continue else: print("""Please type a valid option.[rock,papper,scissor]. Better luck n

25th Jul 2022, 1:54 PM
Sudip Shrestha
Sudip Shrestha - avatar
2 Respuestas
+ 1
Please put "Python" as tag, not "#Nothing". On sololearn Python playground, you need to provide all input before running the program (separated by line breaks). That would require to know how many input one needs to give which is not the case in your program (depends on random and score)
25th Jul 2022, 2:02 PM
Lisa
Lisa - avatar
0
Thanks a lot lisa.
25th Jul 2022, 2:12 PM
Sudip Shrestha
Sudip Shrestha - avatar