python 2.7 - Use commas to join expression components -


  • trafficlightscount =12
  • bufferdist = '5 mi. '
  • intersectioncount = 20
  • print 'found', trafficlightcount, light in intersectioncount, buffer and, 'bufferedist 'intersections.'

a='something' b=12 c='another thing' print 'found : ' + '{0},{1},{2}'.format(a,b,c) 

you output : found : something,12,another thing


Comments

Popular posts from this blog

php - Embed BBCode within itself not working -

three.js - how to load gltf in three JS -

sql server - T-SQL: Access DB objects in same schema without qualifying? -