question on input function
Richel Satumbaga
rlsatumbaga at yahoo.com
Mon Jul 20 04:07:07 CEST 2009
I am just learning python then I encountered an certain point in terms of using the input function of python.
the source code:
eq = input("enter an equation:");
print " the result is : ";
the output seen in the command window:
>>>
enter an equation:[m*x+b for m in (0,10,1),for x in (1,11,1), for b in (2,12,1)]
Traceback (most recent call last):
File "C:/Python26/try", line 1, in <module>
eq = input("enter an equation:");
File "<string>", line 1
[m*x+b for m in (0,10,1),for x in (1,11,1), for b in (2,12,1)]
^
SyntaxError: invalid syntax
Is there any other way to enter those? or it must be coded in the source code?
If in source code is it like in matlab where one can type:
x = [0:1:10];
to define the range of x which is form 0 to 10 with the increment of 1.
Thanks
Ann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090719/1e922a04/attachment.html>
More information about the Python-list
mailing list