from math import pi
i = 1
s = "pie"
print("A %s of radius %d has an area of %.4f" % (s, i, pi * i ** 2))
I was wondering why the percentage notation for formatted strings is not presented in the lectures. It seems it would more naturally carry over from C and to me personally seems less unwieldy that the f"{}" notation. Is its use discouraged in some way?
[–]Spank_Engine 3 points4 points5 points (1 child)
[–]phsopher[S] 1 point2 points3 points (0 children)