Created
March 27, 2014 05:48
-
-
Save pbojinov/9801143 to your computer and use it in GitHub Desktop.
string formatting in python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The sophosticated way | |
formatted_string = "My {0} has {1} whiskers and {2} paws".format('cat', 30, 4) | |
print formatted_string |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment