4a Card Game Set Deck Consists 81 Cards Four Attributes Number One Two Three Color Red Gre Q43863563
4a. In the card game Set, the deck consists of 81 cards, eachwith four attributes:
- number (one, two, three)
- color (red, green, purple)
- shape (diamond, squiggle, oval)
- texture (open, solid, striped). Each possible combination ofattributes occurs exactly once. Build a Python list of tuplesrepresenting this deck; each tuples should include the fourattributes in the order given above.
4b. Define a function is_set that, on input three distinct cardsfrom your deck, returns True if and only if they form a “set”according to the rules of the game. That is, in each of the fourattributes, they are either all the same (say, all green) or alldifferent (say, one red, one green, one purple), not two of one andone of another (say, two greens and a red). If possible, make thisa lambda function.
4c. In the game, one normally looks at twelve cards at a timeand attempts to find a set among these. Write a lambda functionthat, given a list of cards, returns True if and only if itcontains a set. Your answer may use the function is_set that youdefined in 4b.
Expert Answer
Answer to 4a. In the card game Set, the deck consists of 81 cards, each with four attributes: number (one, two, three) color (red,…
OR