Datametica Interview Question

Write a code for generators using example