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
pyvo-lt.pdf
Search
Honza Javorek
June 16, 2018
0
87
pyvo-lt.pdf
Honza Javorek
June 16, 2018
Tweet
Share
More Decks by Honza Javorek
See All by Honza Javorek
Týden pro digitální Česko: Představení junior.guru
honzajavorek
0
95
Junior jako investice: Proč je mít v týmu a jak je zaučovat
honzajavorek
0
420
We Are The Robots
honzajavorek
0
160
How and why I work on junior.guru
honzajavorek
0
170
Jak vzniká junior.guru: Otevřený „startup“ v jednom člověku
honzajavorek
0
170
Založeno 2007
honzajavorek
0
140
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
0
430
Keynote: 12 lessons learned from 9 years of community work
honzajavorek
0
260
12 lessons learned from 9 years of community work
honzajavorek
0
410
Featured
See All Featured
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
Designing for Performance
lara
610
70k
Done Done
chrislema
186
16k
GraphQLとの向き合い方2022年版
quramy
50
14k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
350
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
730
The Pragmatic Product Professional
lauravandoore
37
7.1k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
7.9k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
380
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
1
99
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.1k
Transcript
Format
name = input('Name: ')
print('Hello ', end='') print(name, end='') print('!')
print('Hello ' + name + '!')
year = 2018 print('Happy new year ' + year +
'!')
TypeError: must be str, not int
'Happy new year %d!' % (year,)
'Your name is %s' % (name,) 'Hello %s and %s!'
% (n1, n2) 'Happy new year %d!' % (year,)
'Happy new year %s' % (year,) 'pi = %d' %
(3.14,)
'%10s' % (3.14,) ' 3.14'
C sprintf()
print('Hello {0}!'.format(name))
print(('Hello {0}! {0} is a nice' 'name.').format(name))
print('Hello {} and {}!'.format(n1, n2))
'{:>10}'.format(3.14) ' 3.14'
name = { 'first': 'Honza', 'last': 'Javorek', } print('Hi {first}
{last}!'.format(**name))
print('Hi {first} {last}!'.format( first='Honza', last='Javorek', ))
a = { 'street': 'Ostrovského', 'no': '38a', } print('{a[street]} {a[no]}'.format(a=a))
c = [50.0678996, 14.3953814] print('GPS: {c[0]};{c[1]}'.format(c=c))
from datetime import datetime d = datetime(2018, 6, 20, 19,
0) print('{:%Y-%m-%d %H:%M}'.format(d))
pyformat.info
address = { 'street': 'Ostrovského', 'no': '38a', } coords =
[50.0678996, 14.3953814] text = ('The address is: ' '{address[street]}{address[no]}' '\n' 'GPS: {coords[0]};' '{coords[1]}').format(address=address, coords=coords) print(text)
text = ( 'The address is: ' '{address[street]}{address[no]}' '\n' 'GPS:
{coords[0]};' '{coords[1]}' ).format( address=address, coords=coords ) print(text)
print(( 'The address is: ' '{address[street]}{address[no]}\n' 'GPS: {coords[0]};{coords[1]}').format( address=address, coords=coords
)))))))!:!)!*&^%^FUUUUUUUUUU .format( address=address, coords=coords )
name = 'Honza' year = 2018 print(f'Hello {name}!') print(f'Happy {year}!')
name = 'Honza' year = 2018 print(f'Hello {name.upper()}!') print(f'Next: {year
+ 1}')
theend = dict( cs='konec', en='the end', fr='el fin', ) print(f"{theend['cs'].upper()}")