Simple knn classifier for a uni project, UndergraduateProgramming KNNI need a python code which implements KNN from scratch (basic python imports allowed) such as from math import. Based…