Question: Hi all, i am having troubles coding a few functions on my rummy game. PYTHON CODE def discard_kind(cards): the Function should return True if cards

Hi all,

i am having troubles coding a few functions on my rummy game. PYTHON CODE

def discard_kind(cards):

the Function should return True if cards form 2-, 3- or 4- of a kind in a deck. Otherwise it returns False. If there is not enough cards for a meld it also prints a message about it, as illustrated in the following example runs.

In this function you CANNOT use strings except in calls to print function. In particular, you cannot conver elements of cards to strings.

Some examples of outcomes it should be like.

>>> discard_kind([207, 107, 407]) True >>> discard_kind([207, 107, 405, 305]) False >>> discard_kind([207]) Invalid input. Discardable set needs to have at least 2 cards. Fala

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!