Problem found in tutorial

John W. Hamill elbarto99 at netzero.net
Wed Jun 25 04:13:35 CEST 2008


20JUN2008
By John W. Hamill

	
Errata found in Python tutorial
http://www.python.org
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - 
Error Found by John W. Hamill
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - 
C:\__jh\ftp\python\2_5_2\doc\tutorial\node11.html

>>> unique_words = set(word  for line in page  for word in line.split())

>>> valedictorian = max((student.gpa, student.name) for student in
graduates)

NOTE:  page and graduates are not defined and this won't run without them.
       I defined them like so to make this work:

page = ("The quick brown","fox jumped over","the lazy dog's","back 123
times." )

class Graduate:
	def __init__(self, name, gpa):
		self.name = name
		self.gpa  = gpa
	gpa = 0
	name = ""

graduates = (Graduate("Charlie Brown",8.09), Graduate("Snoopy",3.7),
Graduate("Lucy Brown",3.5))


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - 


John W. Hamill
4503 Elmwood Avenue
Royal Oak, MI 48073-1548
(248)549-2406
elbarto99(AT)netzero.net

____________________________________________________________
Be your own boss today! Easy Fitness Franchises. Click here.
http://thirdpartyoffers.netzero.net/TGL2241/fc/Ioyw6i4vFgOmNNBahnUR5DjpJH9D5T8G7gJ7ScC35A7uLIE47CuV8M/



More information about the Python-list mailing list