diff --git a/Practical 2/q07_miles_to_kilometres.py b/Practical 2/q07_miles_to_kilometres.py index 53a57f7..6526397 100644 --- a/Practical 2/q07_miles_to_kilometres.py +++ b/Practical 2/q07_miles_to_kilometres.py @@ -6,4 +6,5 @@ for i in range(10): print("{0}\t{1:.3f}\t\t{2}\t\t{3:.3f}".format(i+1, (i+1) * 1.609, (i * 5 + 20), (i * 5 + 20)/1.609)) -# are there any other ways to print such columns other than \t ? \ No newline at end of file +# are there any other ways to print such columns other than \t ? +# you can use column width in the format specifier eg {0:10} will reserve 10 columns for the first value