Skip to content

Instantly share code, notes, and snippets.

@pbojinov
Created March 27, 2014 05:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pbojinov/9801143 to your computer and use it in GitHub Desktop.
Save pbojinov/9801143 to your computer and use it in GitHub Desktop.
string formatting in python
# 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