Cognizant interview question

Python pattern codes and mostly base on my ML projects