[sf-lug] [PYCLASS] Still on exercise 2.1

jim jim at well.com
Fri Oct 3 19:37:53 PDT 2008


   your program is working fine. your expectation 
is that you'll see something, but your program 
has no print statements, just three statements: 

5  # well, okay, 5 it is, says the interpreter 
x = 5  # roger, x now references the value 5 
x + 1  # okey dokey, i'll add 1 to x, which is now 6 

   but nowhere do you have a print statement to 
put stuff on the screen so the user can see. 

print 5 
print x = 5 
print x + 1 

   we had an interesting discussion about the 
above statements (mainly the second). 




On Fri, 2008-10-03 at 19:24 -0700, Christian Einfeldt wrote:
> hi,
> 
> I am still trying to get my assignment 2.1 to run.  Here is my script.
> 
> #! /usr/bin/python
> 5
> x = 5
> x + 1
> 
> and here is my attempt to execute it. 
> 
> cje at rb:~$ cd Desktop
> cje at rb:~/Desktop$ python asheesh_homework_exercise_2_1.py 
> cje at rb:~/Desktop$
> 
> In other words, it just returns me to a dollar prompt.  I checked the
> path to python and it is right.  The script should be doing this,
> which is how the code executes in the interpreter:
> 
> cje at rb:~/Desktop$ python
> Python 2.5.1 (r251:54863, Jul 31 2008, 23:17:40) 
> [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> 5
> 5
> >>> x = 5
> >>> x + 1
> 6
> >>> 
> 
> Thanks in advance for any tips! 
> 
> _______________________________________________
> sf-lug mailing list
> sf-lug at linuxmafia.com
> http://linuxmafia.com/mailman/listinfo/sf-lug





More information about the sf-lug mailing list