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
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
46
Introduction to PyCon US 2024
mariatta
0
250
PEP Talk
mariatta
0
660
PyCon US 2023: Sunday Morning Welcome Message
mariatta
0
97
PyConUS2023_Closing.pdf
mariatta
0
120
PyCon US 2023: Saturday Morning Welcome Message
mariatta
0
97
Welcome to PyCon US 2023
mariatta
0
84
PyCon US 2023 Lightning Talk
mariatta
0
220
Contributing to Python
mariatta
0
350
Other Decks in Programming
See All in Programming
インターン生でもAuth0で認証基盤刷新が出来るのか
taku271
0
190
15年続くIoTサービスのSREエンジニアが挑む分散トレーシング導入
melonps
2
170
20260127_試行錯誤の結晶を1冊に。著者が解説 先輩データサイエンティストからの指南書 / author's_commentary_ds_instructions_guide
nash_efp
0
900
CSC307 Lecture 02
javiergs
PRO
1
770
AIで開発はどれくらい加速したのか?AIエージェントによるコード生成を、現場の評価と研究開発の評価の両面からdeep diveしてみる
daisuketakeda
1
970
dchart: charts from deck markup
ajstarks
3
990
AI & Enginnering
codelynx
0
110
開発者から情シスまで - 多様なユーザー層に届けるAPI提供戦略 / Postman API Night Okinawa 2026 Winter
tasshi
0
200
OSSとなったswift-buildで Xcodeのビルドを差し替えられるため 自分でXcodeを直せる時代になっている ダイアモンド問題編
yimajo
3
610
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
540
AI時代のキャリアプラン「技術の引力」からの脱出と「問い」へのいざない / tech-gravity
minodriven
20
6.8k
MDN Web Docs に日本語翻訳でコントリビュート
ohmori_yusuke
0
640
Featured
See All Featured
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
110
My Coaching Mixtape
mlcsv
0
46
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
180
The Mindset for Success: Future Career Progression
greggifford
PRO
0
230
New Earth Scene 8
popppiees
1
1.5k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.1k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
150
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.4k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.7k
A Soul's Torment
seathinner
5
2.2k
sira's awesome portfolio website redesign presentation
elsirapls
0
140
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.9k
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