If you are looking for a ready made solution, you are at the wrong place.
Show us what you have got so far, tell us where you are stuck and we will help point you in the right direction
Generally, starting with what you just learned is a good idea. I am assuming that you just learned about loops prior to this homework assignment. Start from there...
Actually I wanted to print a different triangle(Here at the time of posting, forum editor is eliminating all the spaces) . But it is not possible here to show you all what I actually wanted to print