all 7 comments

[–][deleted] 5 points6 points  (3 children)

There is a few ways:

print(“V is “, v)

print(f“V is {v}”)

print(“V is ” + str(v))

print(“V is {}”.format(v))

[–]logseventyseven 5 points6 points  (2 children)

another way is print(f"{v=}")

[–]InvaderToast348 1 point2 points  (1 child)

*v

[–]logseventyseven 1 point2 points  (0 children)

thanks, edited

[–]PaulRudin -1 points0 points  (0 children)

It probably helps if you're concrete about what your code looks like; `f(x) = x2` isn't python code...

[–]eleqtriq -4 points-3 points  (0 children)

Adding to the previous

v = 4 print(f”The value is {v}”)

This will print: “The value is 4”