[Tutor] HANDLING ERRORS

2005-06-30 Thread Feziwe Mpondo
HI help mi. here's what i tried but it's not working print "Type Control C or -1 to exit" def print_menu(): print '1. Print Phone Numbers' print '2. Add a Phone Number' print '3. Remove a Phone Number' print '4. Lookup a Phone Number' print '5. Quit' print numbers = {} menu

[Tutor] python problem

2005-05-26 Thread Feziwe Mpondo
hi i'm trying to write a code that handle errors help def print_menu(): print '1. Print Phone Numbers' print '2. Add a Phone Number' print '3. Remove a Phone Number' print '4. Lookup a Phone Number' print '5. Quit' print numbers = {} menu_choice = 0 print_menu() while men

[Tutor] clock.py

2005-05-23 Thread Feziwe Mpondo
clock.py,problem is to get the last two digits to be random.her's what i tried from time import time,ctime prev_time = "" while(1): the_time = ctime() if (prev_time != the_time): print "The time is :",ctime(time()) prev_time = the_time guess = 0 number = 1-60 while guess != number

[Tutor] help

2005-05-11 Thread Feziwe Mpondo
hi i'm trying to extend a list program by adding a test, problem is after getting the menu of taking the test i can't seem to get the test running i.e viewing of questions and answers. here's what i tried to do menu_item = 0 list = [] while menu_item !=9: print "-"

Re: [Tutor] problem

2005-05-04 Thread Feziwe Mpondo
#keeps asking for password until it has been entered 3 times password = input(" tell me a password: ") correct = False answer = "Flower" if password == answer: while correct == False ___ Tutor maillist - Tutor@python.org http://mail.python.org/

[Tutor] problem

2005-05-03 Thread Feziwe Mpondo
hi problem :modification of a guessing game excersize to a password asking program. her's what i tried. s = raw_input #asks for a password #prints it if correct password = input( "Tell me a password: ") password ==dal print password,"Tell me a password: " elif password ==dal print "accurate"

Re: [Tutor] Weird import problem with PythonIDE on Mac (was 'import problem')

2005-05-03 Thread Feziwe Mpondo
Chris Smith wrote: > > On Friday, Apr 22, 2005, at 10:00 America/Chicago, Max Noel wrote: > >> >>> Do you have a suggestion as to what can I give a module so it has >>> enough information to execute a function that resides in __main__? >>> Here is a visual of what is going on: >>> >>> --__ma

Re: [Tutor] Python backwards program

2005-04-13 Thread Feziwe Mpondo
Alberto Troiano wrote: You can do this: >>> word=raw_input("Type the word: ") Type the word: Kokiri Forest >>> print word Kokiri Forest >>> print word[::-1] tseroF irikoK But I saw that this gave you a hard time so this is an alternate longer way: >>> backword="" >>> counter=len(word) >>> while c