Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > de.comp.lang.python > #5648

Re: [Python-de] f-string Formatanweisung

Path csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From ruppert@hs-worms.de
Newsgroups de.comp.lang.python
Subject Re: [Python-de] f-string Formatanweisung
Date Mon, 22 Jun 2020 13:22:27 -0000 (UTC)
Organization A noiseless patient Spider
Lines 31
Message-ID <rcqbah$4n9$1@dont-email.me> (permalink)
References <rcq1j2$5b5$1@dont-email.me> <0ce577a1-9f85-f36b-b20b-bd3dd739f511@python-academy.de> <8fda63c0-bb9d-24e3-44dd-5319ce2430b3@python-academy.de> <mailman.251.1592829081.24731.python-de@python.org>
Reply-To ruppert@hs-worms.de
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-15
Content-Transfer-Encoding 8bit
Injection-Date Mon, 22 Jun 2020 13:22:27 -0000 (UTC)
Injection-Info reader02.eternal-september.org; posting-host="35d033fccaeb030a30e4ea7b7d5ed05d"; logging-data="4841"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19DhPx3W7TvcMYqpcr3pPh/"
User-Agent tin/2.4.3-20181224 ("Glen Mhor") (UNIX) (Linux/4.19.0-6-amd64 (x86_64))
Cancel-Lock sha1:MLhKKYKOAeqoMH+RFDzzuf0WcZs=
Xref csiph.com de.comp.lang.python:5648

Show key headers only | View raw


Mike Müller <mmueller@python-academy.de> wrote:
> Am 22.06.20 um 14:27 schrieb Mike Müller:
>> Das `f` gehört vor den String:
>> 
>> a = 5
>> 
>> print(f'{a}')
>> 
>> nicht in den String:
>> 
>> print(f"'{a}'")
> 
> Die falsche Variante richtig geschrieben: ;)
> 
> print("f'{a}'")

Vielen Dank für die schnelle Antwort.

Das, was Sie vorgeschlagen haben, hat auch bei mit funktioniert.
Es funktioniert nicht mehr, wenn die "Indirektionsstufe" ins Spiel
kommt. Dann wird nämlich immer nur der String ausgegeben, aber nicht
interpretiert. 

Ich habe jetzt nochmal beide Varianten ausprobiert.
Bei mir wird immer nur der String ausgegeben, aber nicht interpretiert.
Es ist also alles so wie bisher. Wenn Sie mir helfen wollen, wäre es
vielleicht sinnvoll, dass Sie das Programm aus meinem Posting mal
ablaufen lassen würden.

Vielen Dank und Viele Grüße
M.Ruppert

Back to de.comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

f-string Formatanweisung ruppert@hs-worms.de - 2020-06-22 10:36 +0000
  Re: [Python-de] f-string Formatanweisung Mike Müller <mmueller@python-academy.de> - 2020-06-22 14:27 +0200
  Re: [Python-de] f-string Formatanweisung Mike Müller <mmueller@python-academy.de> - 2020-06-22 14:31 +0200
    Re: [Python-de] f-string Formatanweisung ruppert@hs-worms.de - 2020-06-22 13:22 +0000
  Re: [Python-de] f-string Formatanweisung Stefan Behnel <python-de@behnel.de> - 2020-06-22 14:55 +0200
  Re: f-string Formatanweisung "Andreas B." <ab@sysing.de> - 2020-06-22 15:03 +0200
    Re: f-string Formatanweisung ruppert@hs-worms.de - 2020-06-22 13:28 +0000
  Re: [Python-de] f-string Formatanweisung Stefan Behnel <python-de@behnel.de> - 2020-06-22 15:14 +0200
    Re: [Python-de] f-string Formatanweisung ruppert@hs-worms.de - 2020-06-22 14:03 +0000
    Re: [Python-de] f-string Formatanweisung ruppert@hs-worms.de - 2020-07-13 11:13 +0000

csiph-web