3 ms·
It is not live (unless I am mis-understanding what you mean by live) - it is evaluated once. That is to say: def magic(a, b): return f"{a} and {b}
by svieira 11y ago
It is not live (unless I am mis-understanding what you mean by live) - it is evaluated once. That is to say:
def magic(a, b):
return f"{a} and {b}"
s = magic(4, 8)
print(s)
a, b = 3, 7
print(s)
prints `4 and 8` in both cases.
- imakesnowflakes 11y agoIt is live in the sense that you can take that string literal and put it in a different context and it will result in a different evaluation, possibly yielding different value for the string and possibly different side effects (after calls to evaluate expressions).