Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 21st, 2011, 03:49 PM
Authorized User
 
Join Date: May 2008
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!
 
Old November 30th, 2011, 01:03 PM
Registered User
 
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
 
Old December 5th, 2011, 09:38 AM
Registered User
 
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.





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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.