Re: Python: A Program I'd Love To Understand

  • From: "Littlefield, Tyler" <tyler@xxxxxxxxxxxxx>
  • To: programmingblind@xxxxxxxxxxxxx
  • Date: Wed, 22 Jun 2011 12:01:25 -0600

Hello:
I'm assuming you're not getting any errors because you single quote the key bit of the dictionary. single quotes are as good as double quotes, and I actually think there's some significance which you use, but I'm not sure on that one--I'll leave it for someone else.
On 6/22/2011 11:59 AM, Homme, James wrote:

Hi,

I have lots of questions about the current Python exercise I'm working on, so I'll just ask one at a time. Hope you have lots of patience.

First question. I think I should be getting a compiler error but I'm not. I thought I had to put some sort of quotes around this code after the commas. Why is this compiling OK?

ROOMS = { 'death': death,

  'princess_lives_here': princess_lives_here,

  'gold_koi_pond': gold_koi_pond,

  'big_iron_gate': big_iron_gate,

  'bear_with_sword': bear_with_sword

  }

Thanks.

Jim

Jim Homme,

Usability Services,

Phone: 412-544-1810.


This e-mail and any attachments to it are confidential and are intended solely for use of the individual or entity to whom they are addressed. If you have received this e-mail in error, please notify the sender immediately and then delete it. If you are not the intended recipient, you must not keep, use, disclose, copy or distribute this e-mail without the author's prior permission. The views expressed in this e-mail message do not necessarily represent the views of Highmark Inc., its subsidiaries, or affiliates.


--

Take care,
Ty
my website:
http://tds-solutions.net
my blog:
http://tds-solutions.net/blog
skype: st8amnd127
My programs don't have bugs; they're randomly added features!

Other related posts: