Hi, On 21 April 2014 19:12, Stephen Mik <mik.step...@yahoo.com.dmarc.invalid> wrote: > Dear Python Community: > I am new to Python,with only about a month's experience. I am writing > Python 3.4.0 code that apparently isn't doing what it should be doing. > Specifically, I am inputting or trying to input,a Sentry Variable to a While > Loop. I want to test out the Main program" While" Loop before I add an inner > "While" Loop. The program I have written,when run on the Python 3.4.0 > Shell,does not stop for input of the "While" Sentry Variable,it just gives a > program error: "Value of smv_grandVariable undefined". What am I doing wrong > here?
You are misunderstanding how input() works. It is a function, which means it returns a result, and takes one parameter which is a prompt/message to display, e.g you should have something like this: result = input('Input a string:') This displays 'Input a string:' to the user and then waits for input, after which it puts the inputted value into the variable 'result'. That also hopefully explains the error message -- it's telling you that 'smv_grandVariable', which you've given to input() and which Python's duly trying to display is undefined. (By the way, try to pick a better name for that variable which suggests what its role is supposed to be.) Also see here: https://docs.python.org/3.4/library/functions.html#input Walter _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor