nklin---
- Original Message -
From:
luke
To: tutor@python.org
Sent: Monday, August 08, 2005 12:38
AM
Subject: [Tutor] deck dealing
program
from random import randint
def identify_card(n):
cardname = "" royals =
Just offering my take on the problem.
hope it helps someone.
- Original Message -
From: <[EMAIL PROTECTED]>
To:
Sent: Monday, August 08, 2005 2:02 AM
Subject: Re: [Tutor] deck dealing program
> Are you:
> a.) Having trouble with the code and looking for help?
>
Are you:
a.) Having trouble with the code and looking for help?
b.) Looking for suggestions on how to improve the code?
c.) Offering the code as a demo for Nathan et al.?
I was just doing stuff along the same lines and was having fun seeing the
different approaches to the same problem.
-
from random import randint
def identify_card(n):
cardname = "" royals =
["Jack","Queen","King","Ace"] temp = n %
13 if temp >
8: cardname +=
royals[temp-9]
else: cardname +=
str(temp+2) cardname += " of "
suits =
["Spades","Hearts","Diamonds","Club