Pattern Spaces and Stars(Work)

How the first work is found to be spaces and not stars?

you see for the later lines you need to first print space and then star. so you need to consider that too