Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning Python: Using Python 2.6 and Python 3.1
This is the forum to discuss the Wrox book Beginning Python: Using Python 2.6 and Python 3.1 by James Payne; ISBN: 978-0-470-41463-7
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Python: Using Python 2.6 and Python 3.1 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old March 21st, 2011, 03:49 PM
Authorized User
Points: 47, Level: 1
Points: 47, Level: 1 Points: 47, Level: 1 Points: 47, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2008
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Question Question about dictionaries

I'm working through chapter 3 on variables. In the section on dictionaries (page 39-40 specifically), you define a dictionary variable menu_specials at one time by putting in pairs for keys breakfast, lunch and dinner and their values within a set of curly braces. But, when you run the command print(menu_specials), the dictionary is printed out with lunch first and then breakfast and then dinner. Why does it do that? I can see that it's not in order of entry, nor does it seem to be in order by key (alphabetically) nor by value, so what's up?

Thank you!
Reply With Quote
  #2 (permalink)  
Old November 30th, 2011, 12:03 PM
Registered User
Points: 24, Level: 1
Points: 24, Level: 1 Points: 24, Level: 1 Points: 24, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2011
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
Default Dictionary's order

Hello, I'm having the same problem, is there anyone who can explain why this happens
Reply With Quote
  #3 (permalink)  
Old December 5th, 2011, 08:38 AM
Registered User
Points: 24, Level: 1
Points: 24, Level: 1 Points: 24, Level: 1 Points: 24, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2011
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
Default Dictionary's order

Greetings, I found the answer to your question: you need not worry, dictionaries unlike tuples and lists are just not ordered, hope this answer your question.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
FindControl question and a MasterPage question about controls Rushino ASP.NET 4 General Discussion 3 September 11th, 2010 03:17 PM
Just a question?? Jon2078 BOOK: Beginning XML, 4th Ed ISBN: 978-0-470-11487-2 1 April 11th, 2010 02:04 PM
Disappearing UserName & Question within Customized PasswordRecovery Question Template eddiemcham ASP.NET 3.5 Basics 13 June 13th, 2009 04:23 AM
thanks but i have another question antony maiky CSS Cascading Style Sheets 1 August 20th, 2006 03:52 PM



All times are GMT -4. The time now is 06:20 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.