[Courses] [python] Lesson 1: Hello world

Eric Slehofer eikitalar at gmail.com
Mon Jun 20 23:57:29 UTC 2011


I had a quick question that came to me while experimenting a bit with the
print statement. Normally print gives you one space between the arguments of
the print statement and we've covered how to have no spaces between its
arguments. Now is there a way for you to (for whatever reason) have more
than one space between the arguments of the print statement (other than, for
example, placing spaces in the string itself i.e. print "Hello,       ",
name)?

Also, is there a way to still use single quotes and avoid the problems with
apostrophes in the string? Some sort of escape character, perhaps (like a
backslash in bash)?

- ES

On Mon, Jun 20, 2011 at 6:09 PM, Ricardo Varas Santana <
ricardoivaras at gmail.com> wrote:

> On Fri, Jun 17, 2011 at 6:47 PM, Akkana Peck <akkana at shallowsky.com>
> wrote:
> > ================= Homework =========================
> >
> >
> > 1. I'm interested in hearing what version of Python everybody is running,
> >   on which operating system, distro and version. Please post your
> results!
>
> Python 2.7
> Linux, openSUSE 11.4.
>
> > 2. Why are there two commas in
> >    print "Hello,", name
> >    ? What do you think the difference is between them?
>
> First comma is to separate visually the words, second coma will be
> just to let the print command know about the parameter.
> Not sure if print is called a command, or reserved word, or else.
>
> >
> > 3. Anyone know why the language was named Python?
>
> Not an idea, will find out by goggling or other's reply :D
>
> Regards!
>
> --
> Ricardo Varas Santana
> _______________________________________________
> Courses mailing list
> Courses at linuxchix.org
> http://mailman.linuxchix.org/mailman/listinfo/courses
>


More information about the Courses mailing list