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


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

Re: [Python-de] f-string Formatanweisung

From ruppert@hs-worms.de
Newsgroups de.comp.lang.python
Subject Re: [Python-de] f-string Formatanweisung
Date 2020-06-22 13:22 +0000
Organization A noiseless patient Spider
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>

Show all headers | 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