Upgrade to Pro — share decks privately, control downloads, hide ads and more …

pyvo-lt.pdf

Honza Javorek
June 16, 2018
61

 pyvo-lt.pdf

Honza Javorek

June 16, 2018
Tweet

Transcript

  1. 'Your name is %s' % (name,) 'Hello %s and %s!'

    % (n1, n2) 'Happy new year %d!' % (year,)
  2. from datetime import datetime d = datetime(2018, 6, 20, 19,

    0) print('{:%Y-%m-%d %H:%M}'.format(d))
  3. 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)
  4. text = ( 'The address is: ' '{address[street]}{address[no]}' '\n' 'GPS:

    {coords[0]};' '{coords[1]}' ).format( address=address, coords=coords ) print(text)