Fluent Home interview question

write a python code for a problem