Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Open Source > BOOK: Python Projects
|
BOOK: Python Projects
This is the forum to discuss the Wrox book Python Projects Laura Cassell, Alan Gauld; ISBN: 978-1-118-90866-2
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Python Projects 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 December 21st, 2015, 07:08 PM
Wrox Author
 
Join Date: Feb 2015
Posts: 25
Thanks: 0
Thanked 3 Times in 3 Posts
Default Problem in listbits.py (chapter 1)

Alex Kleider has highlighted a problem with the listbits() function in bitmask.py as described on pages 40/41. The function using default arguments does not print the last bit.

The corrected code should read:

def listbits(self, start=0,end=None):
if end: end = end if end < 0 else end+2
return [int(c) for c in bin(self)[start+2:end]]

I've submitted a corrected file to Wrox and hopefully it will soon appear
on the download site.

Thanks again to Alex and apologies for the slip up.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 1 - bits.py problems saltycraig BOOK: Python Projects 5 October 17th, 2015 12:39 PM
problem on Chapter 5 stzd8 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 November 25th, 2006 07:10 PM
Chapter 2 problem stzd8 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 4 November 6th, 2006 07:08 PM





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