python please Preliminaries Throughout this assignment you will be using the fol
ID: 3709415 • Letter: P
Question
python please
Preliminaries Throughout this assignment you will be using the following Card and Player classes, which are available in the file war classes.py: class Card: def init_(self, rank, suit): self._rank- rank self._suit-suit class Player: CSE 101 - Spring 2018 Homework #5 Page 1 def _init-(self, player_num, score, cards): self._player_num-player_num self._score-score self-cards = cards We see that a Card object is defined by its rank and suit attributes, and a Player object is defined by its ID number, score and card list attributes.Explanation / Answer
# i will write the funtion as the other part of the code is oblivious to me.
def check_game_winner(player1,player2):
if(player1.score>player2.score):
return 1
elif(player2.score>player1.score):
return 2
else:
return 0
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.