Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #65679
| From | Roy Smith <roy@panix.com> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: What does """ means in python? |
| Date | 2014-02-08 09:08 -0500 |
| Organization | PANIX Public Access Internet and UNIX, NYC |
| Message-ID | <roy-C8B893.09080908022014@news.panix.com> (permalink) |
| References | <72a7dd52-7619-4520-991e-20db7ce55ba3@googlegroups.com> |
In article <72a7dd52-7619-4520-991e-20db7ce55ba3@googlegroups.com>,
Sam <lightaiyee@gmail.com> wrote:
> For string, one uses "" to represent string. Below is a code fragment that
> uses """ instead.
>
> cursor.execute("""SELECT name, phone_number
> FROM coworkers
> WHERE name=%s
> AND clue > %s
> LIMIT 5""",
> (name, clue_threshold))
>
> What does """ means in python?
This is what's known as a "triple quoted string" It's just like a
regular string, except that it run across newlines. Very handy for
things like embedding SQL code in a Python program!
It works with single quotes too (i.e. '''this is
a very long string
spread out over several lines'''
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
What does """ means in python? Sam <lightaiyee@gmail.com> - 2014-02-08 06:02 -0800
Re: What does """ means in python? Roy Smith <roy@panix.com> - 2014-02-08 09:08 -0500
Re: What does """ means in python? Walter Hurry <walterhurry@gmail.com> - 2014-02-08 19:55 +0000
Re: What does """ means in python? Chris Angelico <rosuav@gmail.com> - 2014-02-09 08:40 +1100
Vedr: What does """ means in python? Gisle Vanem <gvanem@yahoo.no> - 2014-02-09 05:49 +0000
Re: Vedr: What does """ means in python? Duncan Booth <duncan.booth@invalid.invalid> - 2014-02-10 10:50 +0000
csiph-web