[Tutor] How to take in 2 or more values from user on a single line(like parameters?)

Alan Gauld alan.gauld at btinternet.com
Thu Sep 20 01:14:17 CEST 2007

"Boykie Mackay" <boykie.mackay at gmail.com> wrote

> Is there any simple way of getting parameter input from the user?
> What I want to do is to type in two (or more) values on the command
> prompt and have a function do some work on them and return a result.

Take a look at sys.argv.

And then take a look at my "talking to the user" topic in my tutorial.
The last section covers use of argv to get parameters from the user.


Alan Gauld
Author of the Learn to Program web site

More information about the Tutor mailing list