[Tutor] First script

alan.gauld@bt.com alan.gauld@bt.com
Wed, 17 Jan 2001 10:10:07 -0000


> answer = " "

this is not needed

> query = raw_input("Do you want to restart the INETD daemon? 
> (yes/no): ")
> 
> answer = query

nor is this, just use query...

> if len(answer) > 2:

I'd make the test:

if query[0] in "yY":

>     print r
> elif len(answer) < 2:

and this one:

elif query[0] in "nN":

otherwise if the user tries typing exit, quit or some other panic 
signal more than 3 chars you will do it anyway! Checkking for y/Y 
is more likely to respond as required.

Alan g.