Re: [Tutor] I need advice about which way to go.

2005-08-03 Thread Alan G
> cards = {"Ace", "Two", "Three", "Four", "Five", "Six", "Seven", > "Eight", > "Nine", "Ten", "Jack", "Queen", "King"} > card_types = {"Diamond", "Heart", "Spade", "Club"} {} means they are dictionaries but you don;t provide key:value pairs. You probably want lists here not dictionaries

Re: [Tutor] I need advice about which way to go.

2005-08-03 Thread Nathan Pinno
mond, Club, or Spade) - Original Message - From: Bob Gailer To: Nathan Pinno ; Tutor mailing list ; Yoo, Danny Sent: Wednesday, August 03, 2005 1:03 PM Subject: Re: [Tutor] I need advice about which way to go. At 11:36 AM 8/3/2005, Nathan Pinno wrote: Here is the code the

Re: [Tutor] I need advice about which way to go.

2005-08-03 Thread Bob Gailer
At 11:36 AM 8/3/2005, Nathan Pinno wrote: Here is the code then: I'll throw in some suggestions. 1 - check for balanced parentheses. This has bit you before and you have several lines below with unbalanced parentheses. 2 - since Python indexes start at 0, take advantage of this. Use random.choice

Re: [Tutor] I need advice about which way to go.

2005-08-03 Thread Nathan Pinno
a == 1:    a = cards[0]    playertotal = playertotal + 1    elif a == 2:    a = cards[1]        playertotal = playertotal + 2    Now do you have an idea of what I'm pointing to? - Original Message - From: Bob Gailer To: Nathan Pinno ;

Re: [Tutor] I need advice about which way to go.

2005-08-03 Thread Bob Gailer
At 11:12 AM 8/3/2005, Nathan Pinno wrote: Sorry about that, I thought it was clear that n = number randomly chosen. I was thinking of if the number was a five, it would choose a card with a five on it. I don't want to have to code stuff that I have to repeat again and again. That's what classe

Re: [Tutor] I need advice about which way to go.

2005-08-03 Thread Nathan Pinno
Nathan Pinno" <[EMAIL PROTECTED]>; "Tutor mailing list" Sent: Wednesday, August 03, 2005 1:14 AM Subject: Re: [Tutor] I need advice about which way to go. > Hi Nathan, > > The problem with this problem descripton is that you have an idea > clear in your own head but

Re: [Tutor] I need advice about which way to go.

2005-08-03 Thread Alan G
Hi Nathan, The problem with this problem descripton is that you have an idea clear in your own head but the rest oif us only have the words. So... > I am writing a poker game and a blackjack game. Two separate games or one game that can play both? > I was wondering which way would be Python sma

Re: [Tutor] I need advice.

2005-08-02 Thread Don Parris
On Tue, 2 Aug 2005 10:12:28 +0100 "Alan G" <[EMAIL PROTECTED]> wrote: > > > I forgot to tell that I use Python 2.2.3. When I first got Python, I > > got > > 2.4.1, but it refused to run the second time. So I went and got > > 2.2.3. Your answer would make sense if I had 2.4.1, but I don't. > >

Re: [Tutor] I need advice.

2005-08-02 Thread Nathan Pinno
Tutor mailing list" Sent: Tuesday, August 02, 2005 12:02 AM Subject: Re: [Tutor] I need advice. >I forgot to tell that I use Python 2.2.3. When I first got Python, I got > 2.4.1, but it refused to run the second time. So I went and got 2.2.3. > Your > answer would make

Re: [Tutor] I need advice.

2005-08-02 Thread Nathan Pinno
I think I'll leave this one for someone else. I got too confused too quick. - Original Message - From: "Alan G" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]>; "Tutor mailing list" Sent: Tuesday, August 02, 2005 1:47 AM Sub

Re: [Tutor] I need advice.

2005-08-02 Thread Alan G
> I forgot to tell that I use Python 2.2.3. When I first got Python, I > got > 2.4.1, but it refused to run the second time. So I went and got > 2.2.3. Your answer would make sense if I had 2.4.1, but I don't. Version 2.3 should work and has the datetime stuff I think - just checked and it does

Re: [Tutor] I need advice.

2005-08-02 Thread Alan G
> I want to write a program that will convert time in any other > time zone to my time zone. This is a deceptively complex task. There are around 40 timezones varying by anything from 15 minutes to 2 hours. And some places change timezone throughout the year. Others have multiple daylight savi

Re: [Tutor] I need advice.

2005-08-01 Thread Nathan Pinno
quot;Nathan Pinno" <[EMAIL PROTECTED]> Cc: "Tutor mailing list" Sent: Monday, August 01, 2005 11:41 PM Subject: Re: [Tutor] I need advice. > > > On Mon, 1 Aug 2005, Nathan Pinno wrote: > >> I want to write a program that will convert time in any other time z

Re: [Tutor] I need advice.

2005-08-01 Thread Danny Yoo
On Mon, 1 Aug 2005, Nathan Pinno wrote: > I want to write a program that will convert time in any other time zone > to my time zone. Would it be better to use the Python time molecule or > just a whole bunch of if statements? Hi Nathan, I'd recommend looking at the 'datetime' Python module. G