Can I read Python Output Formatting Basics on EtoBox?
Python Output Formatting Basics by phil is a document available to read on EtoBox.
What is Python Output Formatting Basics about?
1) Basic formatting in Python uses a string specifying the formatting followed by a % symbol and the thing to be formatted. 2) For example, "%.1f"%a will print the floating point value of a with one decimal place by rounding to the specified number of places. 3) Strings can be printed with a specified number of spaces using "%10s" to right adjust a string in 10 spaces or "%-10s" to left adjust.
- Author
- phil
- Language
- EN