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
Mariatta
January 22, 2018
Programming
0
430
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
45
Introduction to PyCon US 2024
mariatta
0
240
PEP Talk
mariatta
0
640
PyCon US 2023: Sunday Morning Welcome Message
mariatta
0
95
PyConUS2023_Closing.pdf
mariatta
0
120
PyCon US 2023: Saturday Morning Welcome Message
mariatta
0
93
Welcome to PyCon US 2023
mariatta
0
82
PyCon US 2023 Lightning Talk
mariatta
0
210
Contributing to Python
mariatta
0
340
Other Decks in Programming
See All in Programming
[AI Engineering Summit Tokyo 2025] LLMは計画業務のゲームチェンジャーか? 最適化業務における活⽤の可能性と限界
terryu16
2
300
Spinner 軸ズレ現象を調べたらレンダリング深淵に飲まれた #レバテックMeetup
bengo4com
1
210
AI時代を生き抜く 新卒エンジニアの生きる道
coconala_engineer
1
530
Kotlin Multiplatform Meetup - Compose Multiplatform 외부 의존성 아키텍처 설계부터 운영까지
wisemuji
0
170
CSC307 Lecture 01
javiergs
PRO
0
670
gunshi
kazupon
1
140
perlをWebAssembly上で動かすと何が嬉しいの??? / Where does Perl-on-Wasm actually make sense?
mackee
0
330
Findy AI+の開発、運用におけるMCP活用事例
starfish719
0
2.1k
[AtCoder Conference 2025] LLMを使った業務AHCの上⼿な解き⽅
terryu16
6
1k
Pythonではじめるオープンデータ分析〜書籍の紹介と書籍で紹介しきれなかった事例の紹介〜
welliving
3
780
実は歴史的なアップデートだと思う AWS Interconnect - multicloud
maroon1st
0
310
インターン生でもAuth0で認証基盤刷新が出来るのか
taku271
0
150
Featured
See All Featured
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
115
100k
Git: the NoSQL Database
bkeepers
PRO
432
66k
Between Models and Reality
mayunak
1
160
Docker and Python
trallard
47
3.7k
Designing for Timeless Needs
cassininazir
0
110
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
270
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.2k
Side Projects
sachag
455
43k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
34k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Optimizing for Happiness
mojombo
379
70k
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