I dont know how to do it

Please give the code or explain me how to do it

I think code is self explanatory
but if you need any help feel free to ask

Code: