I'm using def functions and when I run the code I get "TypeError: '>' not supported between instances of 'int' and 'NoneType'". I get what the error is saying but is there any way to change the nontype into an int?
import random
random.randint(1,3)
def P1():
print("pick ")
playerinput = int(input("rock(1), paper(2), scissors(3):"))
if playerinput == 1:
print("Player 1 chose: rock")
elif playerinput == 2:
print("Player 1 chose: paper")
elif playerinput == 3:
print("Player 1 chose: scissors")
return (playerinput)
def P2():
computer = random.randint(1,3)
if computer == 1:
print("CPU chose: rock")
elif computer == 2:
print("CPU chose: paper")
elif computer == 3:
print("CPU 2 chose: scissors")
def winner():
if P1()>P2():
print("Player 1 wins")
def main():
winner()
main()