Datametica interview question

Write a code for generators using example