Python 101 : Basic formatting


Let's look at some formatting examples:


Below is another example:


We could also do it as follows - {0}: first argument, {1}: second argument -:


Another way, without numbering the arguments:


The below example uses a "float" number:


Using named arguments - "var" in our case - :


Using a "C-like" formatting:

  • %s : String.
  • %d : Decimal notation.

Comments

Popular posts from this blog

Istio 101 : How Istio ServiceEntry relates to Kubernetes Services and Endpoints

Kubernetes 101 : - Scaling a Stateful set -

Python 101 : Generators and Lists