0

My code:

from random import randrange

bot_choice = randrange(3)

bot_scissors=1
bot_rock=2
bot_paper=3

user_scissors=1
user_rock=2
user_paper=3

if bot_choice == 1:
   bot_choice = bot_scissors

if bot_choice == 2:
    bot_choice=bot_rock

if bot_choice == 3:
    bot_choice=bot_paper


user_choice=input("Choose one option; 1 for Scissors, 2 for rock and 3 for paper")

if user_choice == 1:
    print("your choise is Scissors, right?")
    user_choice=user_scissors

if user_choice == 2:
    print("your choise is Rock, right?")
    user_choice=user_rock

if user_choice == 3:
    print("your choise is Paper, right?")
    user_choice=user_paper

if bot_choice == bot_scissors and user_choice == user_scissors:
    print("No one wins!")

if bot_choice == bot_rock and user_choice == user_scissors:
    print("The bot won!")

if bot_choice == bot_paper and user_choice == user_scissors:
    print("You won!")

if bot_choice == bot_scissors and user_choice == user_rock:
    print("You won!")

if bot_choice == bot_rock and user_choice == user_rock:
    print("No one wins!")
    
if bot_choice == bot_paper and user_choice == user_rock:
    print("The bot won!")
    
if bot_choice == bot_scissors and user_choice == user_paper:
    print("The bot won!")

if bot_choice == bot_rock and user_choice == user_paper:
    print("You won!")

if bot_choice == bot_paper and user_choice == user_paper:
    print("No one wins!")

It doesn't give any error, but I don't have any action at the end. I'm a starter in python.

I tried to solve the problem but didn't find any answer to my question, all I search is how I can get to the end.

quamrana
  • 37,849
  • 12
  • 53
  • 71
  • The tag [tag:pygame] is only for questions about [Pygame](https://www.pygame.org/news) – Rabbid76 Nov 04 '22 at 19:42
  • 3
    The input you get from the user is a string, but you compare it against ints - none of the if conditions is met. – Lesiak Nov 04 '22 at 19:44
  • "_i don't have any action at the end_" not sure what this means. Assuming you see none of the `print` statements, that's because `input` returns a string which doesn't match against the `int` you're testing against. – Abhijit Sarkar Nov 04 '22 at 19:44
  • 2
    You meant to write `user_choice = int(input("Choose ... ))`? – quamrana Nov 04 '22 at 19:44
  • 1
    What is the point of all the pieces of code like `if bot_choice == 1:` / `bot_choice = bot_scissors`? `bot_scissors` has a value of 1, so you're assigning 1 to a variable that you just verified already contains a 1. – jasonharper Nov 04 '22 at 19:46

0 Answers0