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 April 30th, 2010, 09:39 PM
m0y m0y is offline
Registered User
 
Join Date: Apr 2010
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!!
 
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.
 
Old October 4th, 2011, 07:20 PM
Registered User
 
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)
 
Old December 6th, 2011, 07:49 PM
Registered User
 
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...





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 11:41 PM





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