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 April 30th, 2010, 09:39 PM
m0y m0y is offline
Registered User
 
Join Date: Apr 2010
Location: Mexico
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to m0y
Lightbulb First big errata

Hello

I found a line full of wrong code on page 40 of this book.

The code goes like this:

>>> hungry=menu_specials.keys()
>>> print(list(hungry))
lunch
breakfast
dinner
>>> starving=menu_specials.value()
>>> print(list(starving))
split pea soup and garlic bread
sausage and eggs
2 hot dogs and onion rings


And the correct one should be:

>>> hungry = menus_specials.keys()
>>> print(list(hungry))
['lunch', 'breakfast', 'dinner']
>>> starving = menus_specials.values()
>>> print (list(starving))
['split pea soup and garlic bread', 'sausage and eggs', '2 hot dogs with onion rings']

I submitted this on the correct place but no one uses this forum so I thought maybe we can interact a little bit while reading this great book.

Greets!!
Reply With Quote
  #2 (permalink)  
Old May 28th, 2010, 10:40 AM
Registered User
 
Join Date: May 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks mate, I am also here for the interaction.

Keep it up.
Reply With Quote
  #3 (permalink)  
Old October 4th, 2011, 07:20 PM
Registered User
Points: 11, Level: 1
Points: 11, Level: 1 Points: 11, Level: 1 Points: 11, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi - I found an error in the Chap 4 prob 5 exercise. I had to use the type conversion, list, in the 3rd line:

Code:
fridge={"spaghetti":"only 2 weeks old","milk":"6 weeks past expiration", "butter":"probably ok","lettuce":"yuk!", "beer":"ice cold six pack of Corona"}
food_sought="tomato"
fridge_list=list(fridge.keys())
items=len(fridge_list)-1
i=0
while i <= items:
    if food_sought == fridge_list[0]:
        print("%s found!  %s " % (food_sought, fridge[food_sought]))
        break
    fridge_list.pop(0)
    i=i+1
    
else:
    print("%s not found." % food_sought)
Reply With Quote
  #4 (permalink)  
Old December 6th, 2011, 06:49 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
Thumbs up Chapter 4, Exercise 5

Hi, I'm also in Exercise 5 and I think you're right. Your code works just fine, I was about to go crazy, thanks and I hope there's more interactions too...
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
How big is too big? chroniclemaster1 XML 5 September 17th, 2012 01:07 AM
Im having a BIG issue here! macupryk General .NET 1 October 10th, 2004 05:24 AM
Big Query hortoristic SQL Server 2000 3 May 25th, 2004 04:01 PM
Upload big file suzila ASP.NET 1.0 and 1.1 Basics 3 March 2nd, 2004 10:41 PM



All times are GMT -4. The time now is 01:21 AM.


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