I created a simple 'stone paper scissors game' in python with oops. why python gives None in the last line of output?
class Game:
def gameWin(self,comp,user):
if comp== user:
print('Match is Tie!')
elif comp=='s':
if user=='p':
print('You won!')
elif user=='c':
print('You Lose!')
elif comp=='p':
if user=='c':
print('You won!')
elif user=='s':
print('You Lose!')
elif comp=='c':
if user=='s':
print('You won!')
elif user=='p':
print('You Lose!')
list=['s','p','c']
comp= random.choice(list)
print('computer turn......')
object=Game()
user=input(('Your turn: select any of one [s,p,c]: '))
print(f'computer chose {comp}')
print(object.gameWin(comp,user))
output:
computer turn......
Your turn: select any of one [s,p,c]: c
computer chose p
You won!
None
why python gives None in the last line?