السلام عليكم
ده المسائل
Rock Paper Scissors
Let's play! You have to return which player won! In case of a draw return Draw!.
وده الاحل بتاعي
def rps(p1 , p2):
if p1 == 'Rock' and p2 == 'Scissors' or p1 == 'Scissors' and p2 == 'Paper' or p1 == 'Paper' and p2 == 'Rock':
return 'Player 1 win'
elif p2 == 'Rock' and p1 == 'Scissors' or p2 == 'Scissors' and p1 == 'Paper' or p2 == 'Paper' and p2 == 'Rock':
return 'Player 2 win'
else:
return 'Draw!'
print(rps('Rock' , 'Rock'))
وده السوال
هل يوجد حل افضل من كده في المسائل ده