What is Precision in Python

Precision is number of labels that are predicted correctly

Example :
An article that has valid tags by human (A) - Flower, Garden, Scenary
Machine learnt model predicts following tags (B)- Flower, Greenary, Nature, Spring, Eco-friendly

Precision = A n B
-----------
B

i.e 1 / 5 = 0.20