Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python print value and variable name

#!/usr/bin/env python3
foo = 1
bar = 2
print(f"{foo=} {bar=}")
Comment

python print variable name

>>> first = 'John'
>>> last = 'Doe'
>>> print '%(first)s %(last)s' % globals()
John Doe
Comment

PREVIOUS NEXT
Code Example
Python :: class python 
Python :: randomly shuffle array python 
Python :: python array input from user 
Python :: how to fix valueerror in python 
Python :: how to get length of string in python 
Python :: check if argv exists python 
Python :: python functions with input 
Python :: django production 
Python :: print first word of a string python and return it 
Python :: in python how to use exp 
Python :: copy files to a directory using text file 
Python :: Python numpy.broadcast_to() Function Example 
Python :: get dataframe column into a list 
Python :: np array to list 
Python :: python int to string 
Python :: how to assign a new value in a column in pandas dataframe 
Python :: pandas groupby counts 
Python :: find max value in list python 
Python :: Extract bounding boxes OpenCV 
Python :: how to make program speak in python 
Python :: python detect warning 
Python :: xml to json in python 
Python :: find string in string python 
Python :: Access item in a list of lists 
Python :: python simple web app 
Python :: bar plot bokeh 
Python :: how to get any letter of a string python 
Python :: in dataframe particular column to string 
Python :: boxplot show values seaborn 
Python :: python str contains word 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =