Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
string formatting
#2
>> print('some {spam}'.format(**foo))
some a
>>> print(f'some {foo["eggs"]}')
some b
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
string formatting - by Uchikago - Jun-28-2019, 03:17 PM
RE: string formatting - by buran - Jun-28-2019, 03:28 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Formatting a date time string read from a csv file DosAtPython 5 1,351 Jun-19-2023, 02:12 PM
Last Post: DosAtPython
  String formatting (strptime) issues Henrio 2 873 Jan-06-2023, 06:57 PM
Last Post: deanhystad
  confused about string formatting barryjo 7 2,021 Mar-06-2022, 02:03 AM
Last Post: snippsat
  string formatting barryjo 7 2,093 Jan-02-2022, 02:08 AM
Last Post: snippsat
  Help with string formatting in classes brthurr 6 9,705 Dec-17-2021, 04:35 PM
Last Post: Jeff900
  Question on HTML formatting with set string in message Cknutson575 3 3,525 Mar-09-2021, 08:11 AM
Last Post: Cknutson575
  smtplib: string formatting not carrying over to email ClassicalSoul 1 2,674 Apr-22-2020, 09:58 PM
Last Post: bowlofred
  String formatting difficulties mmk1995 3 2,810 Aug-09-2019, 11:18 AM
Last Post: wavic
  TypeError: not all arguments converted during string formatting RedSkeleton007 1 14,993 Jul-15-2018, 08:51 PM
Last Post: ichabod801
  formatting string and returning as geojson garynobles 12 6,684 Mar-06-2018, 05:02 PM
Last Post: garynobles

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020