Pages

Sunday, November 4, 2012

Python format string

When using template technique for formatting string, STRING#format can be useful.
print 'Coordinates: {latitude}, {longitude}'.format(latitude='37.24N', longitude='-115.81W')
Coordinates: 37.24N, -115.81W

References

No comments:

Post a Comment