Friday 27 October 2023

Python debug tip

 Want to know a secret?

"*"*100 takes me about 1 second to type.

Why not wrap it in a print?



print("var_a:", var_a) 

print("var_b:", var_b) 

print("var_c:", var_c)  



// var_a: pineapple

// var_b: 64

// var_c: <__main__.Dog object at 0x00000248A53D7748> # 



Isn't that easier to read?

No comments:

Post a Comment