[Tutor] New to this

Alan Gauld alan.gauld at btinternet.com
Mon Jun 21 01:54:43 CEST 2010


"Neil Thorman" <neil.thorman at gmail.com> wrote

> This is from Alan Gauld's Learning to Program: Handling Files.
> http://www.freenetpages.co.uk/hp/alan.gauld/

One other thing. That page is now quite old and out of date. You 
should switch to the current web site:

http://www.alan-g.me.uk/

>>>>inp = file("menu.txt", "r")
> *What is inp? What does it now contain?*

inp is a variable and it is referencing the file object you created
using the file() function. (As the tutor points out you could
also use open() and in fact open() is now preferred over file() )

HTH,

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/




More information about the Tutor mailing list