Using% and .format () for great results!

in format •  7 years ago 

image

Python has had awesome string formatters for years but the documentation on them is too theoretical and technical. With this site we try to show you the most common use cases covered by old and new style format string APIs with practical examples.

All examples on this page work out of the box in Python 2.7, 3.2, 3.3, 3.4, and 3.5 without requiring additional libraries.

More details about these two formatting methods can be found in the official Python documentation:

  • old style
  • new style

If you would like to contribute more examples, feel free to make a pull request in Github!

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Congratulations @stevphoto! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of upvotes

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

Upvote this notification to help all Steemit users. Learn why here!