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
440
0
Share
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
55
Introduction to PyCon US 2024
mariatta
0
260
PEP Talk
mariatta
0
690
PyCon US 2023: Sunday Morning Welcome Message
mariatta
0
110
PyConUS2023_Closing.pdf
mariatta
0
140
PyCon US 2023: Saturday Morning Welcome Message
mariatta
0
110
Welcome to PyCon US 2023
mariatta
0
96
PyCon US 2023 Lightning Talk
mariatta
0
230
Contributing to Python
mariatta
0
360
Other Decks in Programming
See All in Programming
今こそ押さえておきたい アマゾンウェブサービス(AWS)の データベースの基礎 おもクラ #6版
satoshi256kbyte
1
230
PHPのバージョンアップ時にも役立ったAST(2026年版)
matsuo_atsushi
0
290
AI活用のコスパを最大化する方法
ochtum
0
370
Reactive ❤️ Loom: A Forbidden Love Story
franz1981
2
220
煩雑なSkills管理をSoC(関心の分離)により解決する――関心を分離し、プロンプトを部品として育てるためのOSSを作った話 / Solving Complex Skills Management Through SoC (Separation of Concerns)
nrslib
3
630
脱 雰囲気実装!AgentCoreを良い感じにWEBアプリケーションに組み込むために
takuyay0ne
3
440
AI時代のPhpStorm最新事情 #phpcon_odawara
yusuke
0
120
野球解説AI Agentを開発してみた - 2026/02/27 LayerX社内LT会資料
shinyorke
PRO
0
400
2026-03-27 #terminalnight 変数展開とコマンド展開でターミナル作業をスマートにする方法
masasuzu
0
300
Migration to Signals, Signal Forms, Resource API, and NgRx Signal Store @Angular Days 03/2026 Munich
manfredsteyer
PRO
0
240
forteeの改修から振り返るPHPerKaigi 2026
muno92
PRO
3
240
10年分の技術的負債、完済へ ― Claude Code主導のAI駆動開発でスポーツブルを丸ごとリプレイスした話
takuya_houshima
0
1.7k
Featured
See All Featured
The Pragmatic Product Professional
lauravandoore
37
7.2k
Designing for Timeless Needs
cassininazir
0
190
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
64
54k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.8k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.2k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.7k
Context Engineering - Making Every Token Count
addyosmani
9
800
Building AI with AI
inesmontani
PRO
1
860
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.6k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
130
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