def rock_paper_scissor_lizard_spock(p1:str, p2:str)-> str: hashmap = {'rock': ['scissors', 'lizard'], 'paper': ['spock', 'rock'], 'scissors': ['paper', 'lizard'], 'lizard': ['spock', 'paper'], 'spock': ['scissors', 'rock']} return 'Draw!' if p1 == p2 else 'Player 1 wins!' if p2 in hashmap.get(p1) else 'Player 2 wins!'
def rock_paper_scissor_lizard_spock(p1:str, p2:str)-> bool:- def rock_paper_scissor_lizard_spock(p1:str, p2:str)-> str:
- hashmap = {'rock': ['scissors', 'lizard'],
- 'paper': ['spock', 'rock'],
- 'scissors': ['paper', 'lizard'],
- 'lizard': ['spock', 'paper'],
- 'spock': ['scissors', 'rock']}
- return 'Draw!' if p1 == p2 else 'Player 1 wins!' if p2 in hashmap.get(p1) else 'Player 2 wins!'