Posts

Showing posts from August, 2019

python snippet

Creating pr function instead of print yoo = 7 def names (thing): return [name for name , ref in globals ().items() if ref is thing][ 0 ] # print(names(yoo)) def pr (varname): print (names(varname)+ ": " , varname) pr(yoo)