On Tue, Jul 13, 2010 at 08:35:45AM +0100, Alan Gauld wrote:
> If the data gets more complex you could put the data into a class:
>
> class Book:
>      def __init__(self, title, pages=[]):
>          self.title = title
>          self.pages = pages
>
> Books = [ Book('War & Peace", [3,56,88]),
>               Book("Huck Finn", [2,5,19]) ]

Can someone please explain the above 2 lines?

> for book in Books:
>     print book.title, book.pages

With warm regards,
-Payal
-- 
_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to