HyScaler Interview Question

Python coding question, I have been asked to share screen and wrote a code.