Question: Write a function is flush that accepts a list of 5 cards and returns (True or False) whether all of the cards have the same

Write a function is flush that accepts a list of 5 cards and returns (True or False) whether all of the cards have the same suit. Each card in the input will be represented as a two character string. The first character will be the rank: 'T' (Ten), '' (Jack), 'Q' (Queen), 'K (King), 'A' (Ace), or a digit 2-9. The second character will be the suit: 'S' (Spades), 'H' (Hearts), 'C' (Clubs), or 'D' (Diamonds). Sample test cases: Input: ['TS', 'IS', 'S', 'KS', 'AS'] Output: True Input: Output: [3HA, TH', 'QH", 9s', 'TH'] False Problem 2 Write a function high_card that accepts a list of 5 cards and returns the rank of the high card. Cards will be specified the same way as in Problem 1. When deciding the high card, only the card rank matters: Ace is the highest, followed by King, Queen, Jack, Ten, then the numbers 9 down to 2, in that order. The high_card function should return the rank of the highest card (2-9, T, J, Q, K, or A). Sample test cases: Input: Output: ['TS', 'S', 'S', 'S', 'AS'] 'A' Input: ['2H', '4C', 'D', '6H', '45'] Output: 81 Input: ['90', 'T', 'TH', 'os', 'H' ] Output
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
