Tech Mahindra interview question

Python coding questions with medium difficulty