0

How can i print the variable name and value as an argument passed

For ex:

snow = 10
print("snow : "  , snow)

Above would work all fine but i want to use the word/parameter "snow" only one time and maybe pass that as a single argument.

  • I mean you can use `f-string` to accomplish that like this: `print(f"{snow}")` but your debug won't make sense just having it passed once like that. – de_classified Sep 16 '20 at 03:52
  • https://ibb.co/ZfBzqP5 .. this is probably easier than the question noted in the close..more help here: https://stackoverflow.com/questions/18425225/getting-the-name-of-a-variable-as-a-string – Derek Eden Sep 16 '20 at 04:02

0 Answers0