Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
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
0
440
f-strings
Lightning talk about f-strings. Presented at PyCascades 2018 in Vancouver.
Mariatta
January 22, 2018
Tweet
Share
More Decks by Mariatta
See All by Mariatta
There's an API for That!
mariatta
0
54
Introduction to PyCon US 2024
mariatta
0
260
PEP Talk
mariatta
0
680
PyCon US 2023: Sunday Morning Welcome Message
mariatta
0
110
PyConUS2023_Closing.pdf
mariatta
0
130
PyCon US 2023: Saturday Morning Welcome Message
mariatta
0
110
Welcome to PyCon US 2023
mariatta
0
93
PyCon US 2023 Lightning Talk
mariatta
0
230
Contributing to Python
mariatta
0
360
Other Decks in Programming
See All in Programming
へんな働き方
yusukebe
5
2.8k
DevinとClaude Code、SREの現場で使い倒してみた件
karia
1
1.1k
我々はなぜ「層」を分けるのか〜「関心の分離」と「抽象化」で手に入れる変更に強いシンプルな設計〜 #phperkaigi / PHPerKaigi 2026
shogogg
2
180
Laravel Nightwatchの裏側 - Laravel公式Observabilityツールを支える設計と実装
avosalmon
1
140
[SF Ruby Feb'26] The Silicon Heel
palkan
0
120
AI駆動開発の本音 〜Claude Code並列開発で見えたエンジニアの新しい役割〜
hisuzuya
4
530
PHPのバージョンアップ時にも役立ったAST(2026年版)
matsuo_atsushi
0
230
CS教育のDX AIによる育成の効率化
niftycorp
PRO
0
150
Rethinking API Platform Filters
vinceamstoutz
0
120
Redox OS でのネームスペース管理と chroot の実現
isanethen
0
390
「やめとこ」がなくなった — 1月にZennを始めて22本書いた AI共創開発のリアル
atani14
0
420
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
780
Featured
See All Featured
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
89
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
210
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
320
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
130
HDC tutorial
michielstock
1
580
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.4k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.1k
The SEO Collaboration Effect
kristinabergwall1
0
400
Embracing the Ebb and Flow
colly
88
5k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
230
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