Black Friday 60% off all 6 of our eBooks: $122 $48.80 Ends in 12d 11h 57m Get the bundle for $48.80

Code for How to Print Variable Name and Value in Python


View on Github

print_variable_name_and_value.py

# Normal way to print variable name and value
name = "Abdou"
age = 24
print(f"name: {name}, age: {age}")

# using the "=" sign
print(f"{name=}, {age=}")