In my python class, we are using python 3.4.1 And we are typing in the programs from the book. Well, I've typed it in correctly and the output still doesn't align the decimal points. Can anyone help? It would be greatly appreciated. Here's the program code:
# This program displays the following
# floating-point numbers in a column
# with their decimal points aligned.
num1 = 127.899
num2 = 3456.148
num3 = 3.776
num4 = 264.821
num5 = 88.081
num6 = 799.999
# Display each number in a field of 7 spaces
# with 2 decimal places.
"Aligning" depends also on the font used. If you are displaying the result in the console, then the console must use a fixed witdth font. If you want to experiment, save the result to a file, open the file with any text/word processor and change the font from proportional to fixed width.
Thank you, Gribouillis and woooee! I had my font on arial and try calibri, neither worked to correct the problem. But when I copied my output to notepad, and looked at the font setting, it hit me can a rockslide. I needed to set it to font Consolas
Now, the decimal point are perfectly aligned. Thank you for your help, helping this old school beginning programmer.