Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #18261
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news-transit.tcx.org.uk!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <yasar11732@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.087 |
| X-Spam-Evidence | '*H*': 0.83; '*S*': 0.00; 'variable,': 0.07; 'advance.': 0.09; 'to:addr:comp.lang.python': 0.09; 'e-posta': 0.16; 'subject:vs.': 0.16; 'this:': 0.16; 'dec': 0.22; 'header:In- Reply-To:1': 0.22; 'formatting': 0.23; 'sat,': 0.25; 'putting': 0.28; '+0200': 0.28; 'print': 0.29; 'example': 0.29; 'thanks': 0.31; 'everyone,': 0.32; 'header:User-Agent:1': 0.33; 'to:addr :python-list': 0.34; 'to:no real name:2**1': 0.35; 'question': 0.36; 'david': 0.36; 'received:74.125': 0.37; 'received:google.com': 0.37; 'using': 0.38; 'put': 0.38; 'should': 0.39; 'to:addr:python.org': 0.40; 'to:2**2': 0.61; 'quick': 0.61; '2011': 0.61; 'your': 0.61; 'love': 0.62; 'message- id:@localhost.localdomain': 0.78; 'ile': 0.84; 'received:139': 0.84 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=content-type:to:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=ARxu2ybbNO+lXMsF6BsG+RYf137SQ6Q9kBRyMj7VklY=; b=XV0j/YHAia1QEIAqnMmnw4o+eNHfiKZY+RuAn/MSfA7xBxDwN28sV4hppdbZrQ/s0c v4cj6AjueRQpNrOrdGW2yRWsYSsOWu1GdBbJsGg3Mvrbq5Ov4zcx7Z9G8dT4rYubstxx to9PhjGNMwDCMDO+6DpmuDlSyyThddmB+FXJQ= |
| Content-Type | text/plain; charset=utf-8; format=flowed; delsp=yes |
| To | python-list@python.org, davidfx <dgeorge29ca@gmail.com>, comp.lang.python@googlegroups.com |
| Subject | Re: .format vs. % |
| References | <5642862.375.1325355574622.JavaMail.geo-discussion-forums@vbbhx10> |
| Date | Sat, 31 Dec 2011 20:34:01 +0200 |
| MIME-Version | 1.0 |
| Content-Transfer-Encoding | Quoted-Printable |
| From | Yaşar Arabacı <yasar11732@gmail.com> |
| In-Reply-To | <5642862.375.1325355574622.JavaMail.geo-discussion-forums@vbbhx10> |
| User-Agent | Opera Mail/11.60 (Linux) |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.12 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.4267.1325356518.27778.python-list@python.org> (permalink) |
| Lines | 33 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1325356518 news.xs4all.nl 6861 [2001:888:2000:d::a6]:40071 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.python:18261 |
Show key headers only | View raw
What exactly do you mean by putting .format into a variable? You mean like
this:
"{name} is very {adj}
{gender}".format(name="sandy",adj="diligent",gender="female")
Sat, 31 Dec 2011 20:19:34 +0200 tarihinde davidfx <dgeorge29ca@gmail.com>
şöyle yazmış:
> Hello everyone,
> I just have a quick question about .format and %r %s %d.
>
> Should we always be using .format() for formatting strings or %?
>
> Example a = 'apples'
> print "I love {0}.".format(a)
>
> If I wanted to put .format into a variable, how would I do that.
>
> Thanks for your information in advance.
>
> David
--
Opera'nın e-posta istemcisi ile gönderildi: http://www.opera.com/mail
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
.format vs. % davidfx <dgeorge29ca@gmail.com> - 2011-12-31 10:19 -0800
Re: .format vs. % Andrew Berg <bahamutzero8825@gmail.com> - 2011-12-31 12:34 -0600
Re: .format vs. % Yaşar Arabacı <yasar11732@gmail.com> - 2011-12-31 20:34 +0200
Re: .format vs. % davidfx <dgeorge29ca@gmail.com> - 2011-12-31 10:44 -0800
Re: .format vs. % davidfx <dgeorge29ca@gmail.com> - 2011-12-31 10:44 -0800
Re: .format vs. % Yaşar Arabacı <yasar11732@gmail.com> - 2011-12-31 20:51 +0200
Re: .format vs. % Evan Driscoll <edriscoll@wisc.edu> - 2011-12-31 13:47 -0500
Re: .format vs. % Miki Tebeka <miki.tebeka@gmail.com> - 2012-01-01 13:11 -0800
Re: .format vs. % Terry Reedy <tjreedy@udel.edu> - 2012-01-02 05:29 -0500
Re: .format vs. % Miki Tebeka <miki.tebeka@gmail.com> - 2012-01-01 13:11 -0800
Re: .format vs. % Alexander Kapps <alex.kapps@web.de> - 2011-12-31 19:59 +0100
Re: .format vs. % Tim Chase <python.list@tim.thechases.com> - 2011-12-31 13:24 -0600
Re: .format vs. % Lie Ryan <lie.1296@gmail.com> - 2012-01-01 06:34 +1100
Re: .format vs. % Robert Kern <robert.kern@gmail.com> - 2011-12-31 19:43 +0000
Re: .format vs. % Terry Reedy <tjreedy@udel.edu> - 2011-12-31 16:09 -0500
Re: .format vs. % Ethan Furman <ethan@stoneleaf.us> - 2012-01-02 14:00 -0800
Re: .format vs. % Rick Johnson <rantingrickjohnson@gmail.com> - 2012-01-02 17:59 -0800
Re: .format vs. % Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-01-03 03:52 +0000
Re: .format vs. % Ian Kelly <ian.g.kelly@gmail.com> - 2012-01-02 22:58 -0700
Re: .format vs. % Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-01-03 06:15 +0000
Re: .format vs. % Ian Kelly <ian.g.kelly@gmail.com> - 2012-01-03 01:16 -0700
Re: .format vs. % Ethan Furman <ethan@stoneleaf.us> - 2012-01-03 05:26 -0800
Re: .format vs. % Ethan Furman <ethan@stoneleaf.us> - 2012-01-03 11:38 -0800
Re: .format vs. % Devin Jeanpierre <jeanpierreda@gmail.com> - 2012-01-03 15:02 -0500
Re: .format vs. % Ethan Furman <ethan@stoneleaf.us> - 2012-01-03 12:16 -0800
Re: .format vs. % Andrew Berg <bahamutzero8825@gmail.com> - 2012-01-03 04:55 -0600
Re: .format vs. % Stefan Krah <stefan-usenet@bytereef.org> - 2012-01-03 12:47 +0100
Re: .format vs. % Neil Cerutti <neilc@norwich.edu> - 2012-01-03 13:58 +0000
Re: .format vs. % Stefan Krah <stefan-usenet@bytereef.org> - 2012-01-03 15:17 +0100
Re: .format vs. % Neil Cerutti <neilc@norwich.edu> - 2012-01-03 15:15 +0000
Re: .format vs. % Neil Cerutti <neilc@norwich.edu> - 2012-01-03 15:24 +0000
Re: .format vs. % Neil Cerutti <neilc@norwich.edu> - 2012-01-03 19:46 +0000
Re: .format vs. % Ethan Furman <ethan@stoneleaf.us> - 2012-01-03 12:00 -0800
Re: .format vs. % Stefan Krah <stefan-usenet@bytereef.org> - 2012-01-03 21:53 +0100
Re: .format vs. % Chris Angelico <rosuav@gmail.com> - 2012-01-04 00:04 +1100
Re: .format vs. % Rick Johnson <rantingrickjohnson@gmail.com> - 2012-01-02 17:51 -0800
Re: .format vs. % Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-01-03 03:47 +0000
Re: .format vs. % 88888 Dihedral <dihedral88888@googlemail.com> - 2012-01-03 07:47 -0800
Re: .format vs. % alex23 <wuwei23@gmail.com> - 2012-01-03 18:26 -0800
Re: .format vs. % 88888 Dihedral <dihedral88888@googlemail.com> - 2012-01-04 00:25 -0800
Re: .format vs. % alex23 <wuwei23@gmail.com> - 2012-01-04 16:23 -0800
Re: .format vs. % 88888 Dihedral <dihedral88888@googlemail.com> - 2012-01-04 17:41 -0800
csiph-web