Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
f-strings
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Mariatta
January 22, 2018
Programming
450
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
f-strings
Lightning talk about f-strings. Presented at PyCascades 2018 in Vancouver.
Mariatta
January 22, 2018
More Decks by Mariatta
See All by Mariatta
There's an API for That!
mariatta
0
76
Introduction to PyCon US 2024
mariatta
0
300
PEP Talk
mariatta
0
890
PyCon US 2023: Sunday Morning Welcome Message
mariatta
0
130
PyConUS2023_Closing.pdf
mariatta
0
170
PyCon US 2023: Saturday Morning Welcome Message
mariatta
0
140
Welcome to PyCon US 2023
mariatta
0
140
PyCon US 2023 Lightning Talk
mariatta
0
280
Contributing to Python
mariatta
0
430
Other Decks in Programming
See All in Programming
Simple Storage Service(S3) is not simple
iwatsukayura
0
260
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
5
5.1k
機械に任せるテスト、人が見るテスト ⽣成AIで引き直した、運⽤保守フェーズの線引き
dske104
0
180
AI が書く Go コードの品質を劇的に向上させる Linter: “declscope”
mpyw
0
490
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
990
mrbgem 三角測量 開発
ogom
0
240
【加筆修正版】Laravel のアプリケーションをどこにデプロイするか #phpcon_ehime
akase244
0
150
なぜCTOを降りてFDEを選んだのか?〜なぜプロダクト企業がFDEで顧客の現場に踏み込むのか〜
gonta
1
190
ChromeでローカルLLM
ryu1013
0
110
re:Inventに行く前に知っておきたい現地参加のノウハウ
nokomoro3
0
400
半永久的に提供し続けられるプライベートクラウドを目指して ― 利用者の認知負荷を抑えるAPI抽象化とハードウェア世代交代の基盤設計
tomokon
0
480
[ハンズオン]AIへの指示だけで「五目並べ」を作ってみよう
satoshi256kbyte
1
370
Featured
See All Featured
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
2
410
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
710
Bash Introduction
62gerente
615
220k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.9k
How STYLIGHT went responsive
nonsquared
100
6.3k
Visualization
eitanlees
153
17k
RailsConf 2023
tenderlove
30
1.6k
Unsuck your backbone
ammeep
672
58k
Odyssey Design
rkendrick25
PRO
2
870
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
The SEO Collaboration Effect
kristinabergwall1
1
590
Transcript
F-strings @mariatta
F-strings?
the new way to format strings
starting in Python 3.6
How?
How? "Hello, %s. You’re %s." % (name, age)
How? "Hello, {name}. You’re {age}.".format(name=name, age=age) "Hello, %s. You’re %s."
% (name, age)
How? "Hello, {name}. You’re {age}.".format(name=name, age=age) f"Hello, {name}. You’re {age}."
"Hello, %s. You’re %s." % (name, age)
Alternate usage
Alternate usage f"Hello, {name}. You’re {age}."
Alternate usage F"Hello, {name}. You’re {age}." f"Hello, {name}. You’re {age}."
Call a function >>> def to_uppercase(input): ... return input.upper() ...
>>> name = “bart simpson” >>> print(f"Hi {to_uppercase(name)}!") Hi BART SIMPSON!
Format specifiers >>> pycascades = datetime(year=2018, month=1, day=22) >>> print(f"{pycascades:%b
%d, %Y}") Jan 22, 2018
F-strings
Faster than str.format
Python 3.6
Free download www.python.org
Build from source https://docs.python.org/3.6/using/unix.html
Change your OS consider: MacOS X, Windows 10, fedora 26,
ubuntu 17.10
None