Python print() statements: part 4 f-strings

In the last post, we learned how to control the precision of the number we print as well as the number of spaces these numbers take up. The last thing we need to learn to output nice data tables is how to align text and numbers when we use .format(). Aligning text and numbers with .format() We previously learned to
Read moreIn the last post, we learned how to use .format() to improve the quality of our print() statements. You may have noticed that we were still printing lots of values after the decimal point, more than are necessary. In this post we will learn to control the presentation of numerical values. Representing and adjusting numbers using .format() With the .format()
Read moreIn the last post, our program printed out the computed BMI with lots of precision (24.489795918367346) and no additional information. In hindsight, it would have been more informative to tell the user that A weight of 75 kg and a height of 1.75 meters equal a MBI if 24.5. In the next few posts we will learn how to create
Read more