Bläddra i källkod

Back to Python 3, easier for now.

Swaroop C H 12 år sedan
förälder
incheckning
2799d7d883
5 ändrade filer med 12 tillägg och 14 borttagningar
  1. 1 1
      01-frontpage.pd
  2. 1 1
      02-preface.pd
  3. 2 4
      03-intro.pd
  4. 7 7
      08-control-flow.pd
  5. 1 1
      10-modules.pd

+ 1 - 1
01-frontpage.pd

@@ -2,7 +2,7 @@
 
 'A Byte of Python' is a free book on programming using the Python language. It serves as a tutorial or guide to the Python language for a beginner audience. If all you know about computers is how to save text files, then this is the book for you.
 
-(Note that this book is primarily for the still-in-common-use Python 2.x but teaches you to write in a way that is upgradable to Python 3.x. If you don't know what that means, please ignore the previous sentence ;-))
+This book is written for the latest Python 3, even though Python 2 is the commonly found version of Python today.
 
 ## Who Reads A Byte of Python?
 

+ 1 - 1
02-preface.pd

@@ -24,7 +24,7 @@ In the true spirit of open source, I have received lots of constructive suggesti
 
 ## Status Of The Book
 
-This book has been reformatted in October 2012 using Pandoc to allow generation of ebooks as requested by several users, and updated to use Python 2 with 3-isms mentioned throughout the book.
+This book has been reformatted in October 2012 using Pandoc to allow generation of ebooks as requested by several users, along with a plethora of errata fixes and updates.
 
 Changes in December 2008 edition from the earlier major revision in March 2005 was updating for the Python 3.0 release.
 

+ 2 - 4
03-intro.pd

@@ -61,13 +61,11 @@ The Python Standard Library is huge indeed. It can help you do various things in
 
 Python is indeed an exciting and powerful language. It has the right combination of performance and features that make writing programs in Python both fun and easy.
 
-## Python 3
+## Python 2 versus 3
 
 You can ignore this section if you're not interested in the difference between Python 2 and Python 3. But please do be aware of which version you are using.
 
-This book was rewritten in 2008 for Python 3. This had resulted in confusion for readers who would try to use Python 2 with the Python 3 version of the book and vice-versa. And slowly, the world is still migrating to Python 3 but that is still a few years away.
-
-In 2012, I have begun migrating this book back to Python 2 but with an eye on making the reader write in a Python 3-friendly manner.
+This book was rewritten in 2008 for Python 3. This had resulted in confusion for readers who would try to use Python 2 with the Python 3 version of the book and vice-versa. And slowly, the world is still migrating to Python 3. With an eye towards the future, this book is written for Python 3.
 
 For details on how to migrate from Python 2 to Python 3, see the [Python/3 page on the Ubuntu wiki](https://wiki.ubuntu.com/Python/3).
 

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 7 - 7
08-control-flow.pd


+ 1 - 1
10-modules.pd

@@ -78,7 +78,7 @@ Example:
 
 ~~~python
 from math import *  
-n = raw_input("Enter range:-  ")
+n = input("Enter range:-  ")
 p = [2, 3]
 count = 2
 a = 5