Mindteck interview question

python logics and data stactures