Is there a faster or shorter way of writing the following code to aviod calculating f(x)
twice without defining another variable?
# could be any function or condition
if f(x) == 0:
print(f(x))
# with additional variable
y = f(x)
if y == 0:
print(y)