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

Christian Einfeldt einfeldt at gmail.com
Fri Oct 3 19:59:50 PDT 2008


hi

Thanks, Jim, you have made me happy as a clam.  I modified my script, and
now I can get it to print the sum of x + 1

On Fri, Oct 3, 2008 at 7:37 PM, jim <jim at well.com> wrote:

>
>   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


here is my new script:

#! /usr/bin/python
5
x = 5
print x + 1

and here is how it runs:

cje at rb:~/Desktop$ python asheesh_homework_exercise_2_1.py
6
cje at rb:~/Desktop$

In other words, it works correctly!  woo hoo!  My very first script!  Thanks
for helping me get that piece done, Jim!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://linuxmafia.com/pipermail/sf-lug/attachments/20081003/6f2596f7/attachment.html>


More information about the sf-lug mailing list