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

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -