PPA-2
Question
Print the following pattern.
There are no spaces between consecutive stars. There are no spaces at the end of each line.
Hint
There are two ways of solving this problem. Consider the third line of the output. We could either do it this way:
Or this way:
Multiplying a string by a number results in replication of the string. For example:
This gives the output:
As a follow up question, what do you think will happen if we multiply a string by \(0\)?
And what about multiplying a string by a number that is not an integer?