Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
f-strings
Search
Mariatta
January 22, 2018
Programming
0
420
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
44
Introduction to PyCon US 2024
mariatta
0
240
PEP Talk
mariatta
0
640
PyCon US 2023: Sunday Morning Welcome Message
mariatta
0
93
PyConUS2023_Closing.pdf
mariatta
0
120
PyCon US 2023: Saturday Morning Welcome Message
mariatta
0
91
Welcome to PyCon US 2023
mariatta
0
81
PyCon US 2023 Lightning Talk
mariatta
0
210
Contributing to Python
mariatta
0
340
Other Decks in Programming
See All in Programming
Flutter On-device AI로 완성하는 오프라인 앱, 박제창 @DevFest INCHEON 2025
itsmedreamwalker
1
140
perlをWebAssembly上で動かすと何が嬉しいの??? / Where does Perl-on-Wasm actually make sense?
mackee
0
110
SwiftUIで本格音ゲー実装してみた
hypebeans
0
480
Go コードベースの構成と AI コンテキスト定義
andpad
0
130
Claude Codeの「Compacting Conversation」を体感50%減! CLAUDE.md + 8 Skills で挑むコンテキスト管理術
kmurahama
1
610
Navigation 3: 적응형 UI를 위한 앱 탐색
fornewid
1
440
Rubyで鍛える仕組み化プロヂュース力
muryoimpl
0
150
ローカルLLMを⽤いてコード補完を⾏う VSCode拡張機能を作ってみた
nearme_tech
PRO
0
140
LLM Çağında Backend Olmak: 10 Milyon Prompt'u Milisaniyede Sorgulamak
selcukusta
0
130
Cell-Based Architecture
larchanjo
0
140
Rediscover the Console - SymfonyCon Amsterdam 2025
chalasr
2
190
Graviton と Nitro と私
maroon1st
0
130
Featured
See All Featured
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
84
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.4k
4 Signs Your Business is Dying
shpigford
186
22k
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.3k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Principles of Awesome APIs and How to Build Them.
keavy
127
17k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
How to build a perfect <img>
jonoalderson
0
4.6k
The Language of Interfaces
destraynor
162
25k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
400
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
1
23
How Software Deployment tools have changed in the past 20 years
geshan
0
30k
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