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
Post a Comment