On Jan 10, 2005, at 14:31, john stanley wrote:

This is my first attempt at programing and my first program sort of did work hear is the program and if any one can tell me what i did wrong or forgot i would appreciate it



a = input("Type in the Grose: ")
b = input("type in the Miles: ")
print "a * 0.74 / b is" a*0.74/b

as you can see it should be realy easy program once it works

The first thing to do is to look at the error that was caused, and what caused it. Python is good at it, as it shows you the exact line, and even the exact character where the error happened. Now, this example is trivial, but in the future, when you have such a problem, please include the traceback in your message, thanks.


Anyway, the error happens in the last line, just before the last expression (a*0.74/b). Which is logical, because that expression is in no way linked to the string that's before it. I suppose you want to display the result of the expression right after the string, don't you? Then you might want to use the string concatenation operator: +
It should be easy to correct, now...



-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting and sweating as you run through my corridors... How can you challenge a perfect, immortal machine?"


_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to