[Tutor] addressbook program

2008-06-28 Thread Danny Laya
Hi I am making an addressBook program now, and you know ... another error message , the program doesn't work. This is the code : # Loading the addressbook filename = "addbook.dat" def readBook(book)     import os     if os.path.exists(filename):     store = open(filename,'r')     for line i

[Tutor] addressbook program

2008-06-28 Thread Danny Laya
Hi I am making an addressBook program now, and you know some problem, the program doesn't work. This is the code : # Loading the addressbook filename = "addbook.dat" def readBook(book)     import os     if os.path.exists(filename):     store = open(filename,'r')     for line in store:         na

[Tutor] For Loop question

2008-06-26 Thread Danny Laya
Hi I'm learning FOR loop now, very easy too learn. But I get confused to understand this code : myList = [1,2,3,4] for index in range(len(myList)): myList[index] += 1 print myList And the response is: [2, 3, 4, 5] Can you explain me as a newbie, how that code works ?? _

[Tutor] fibonacci.py task ???

2008-06-24 Thread Danny Laya
Hi all, can you explain me what this code mean : Fibonacci.py # This program calculates the Fibonacci sequence a = 0 b = 1 count = 0 max_count = 20 while count < max_count: count = count + 1 # we need to keep track of a since we change it old_a = a old_b = b a = old_b b

[Tutor] Another Newbie question

2008-06-24 Thread Danny Laya
Hi I got some problem about writting convention in python. Some tutorial ask me to write this : a = 1 s = 0 print 'Enter Numbers to add to the sum.' print 'Enter 0 to quit.' while a != 0: print 'Current Sum:', s a = int(raw_input('Number? ')) s = s + a print 'Total Sum =', s And the

Re: [Tutor] From Newbie

2008-06-22 Thread Danny Laya
Few... Thanks all, i have found the wrong, i miss some space between != and 0. Thank's for the help. I really apreciate it ! ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] From Newbie

2008-06-22 Thread Danny Laya
Hi ! I have learned wiki tutor for non-programmer and I found some hill that stopping me. In Non-Programmer's Tutorial for Python/Count to 10, wiki ask me to write this code : a = 1 s = 0 print 'Enter Numbers to add to the sum.' print 'Enter 0 to quit.' while a != 0: print 'Current Sum:', s