I can't find the "NONE" which keeps printing after DISPLAYING the message
whats your move on "scissor" "paper" and "rock" ?!
rock
computer-paper
sorry man you lost
None
message={
"loose":"sorry man you lost",
"win":"YOU WIN ",
"tie":"it's a tie"
}
def game(user,comp):
if user==comp:
print(message.get("tie"))
elif user=="scissor" and comp=="paper":
print(message.get("win"))
elif user=="paper" and comp=="rock":
print(message.get("win"))
elif user=="rock" and comp=="scissor":
print(message.get("win"))
else:
print(message.get("loose"))
user=input('''what's your move on "scissor" "paper" and "rock" ?!\n ''')
import random
comp=random.randint(1,3)
if comp==1:
comp="scissor"
elif comp==2:
comp="paper"
elif comp==3:
comp="rock"
print("computer-",comp)
x=(game(user,comp))
print(x)
The game()
function prints things, but it doesn't return anything.
So when you print the return value of game()
, you print None.