[Tutor] Is it possible to...

Alan G alan.gauld at freenet.co.uk
Mon Aug 15 10:16:25 CEST 2005


> Is it possible to create a def that not only deals cards, but also
> assigns a value to each rank, except that the Jacks, Queens, and 
> Kings
> all are the same value as the 10s?

Yes. And you probably need to use a dictionary to hold the value 
against
the card.

> Sorry if I'm asking what for most people is a basic question,

Nope, this is a very good question. I haven't been paying attention to
the card dealing functions posted recently but I assume adding in a
dictionary to assign a value per card dealt wouldn't be too hard.
You could then return the cards as tuples or somesuch...

Alan G




More information about the Tutor mailing list