- Define a function star(m) so that it will print out m rows of star,
where each row consists of 3 consecutive stars.
- Please remember the syntax of definite loop is
for <variable> in range(<number>):
M = ? 5
***
***
***
***
***
- Define a function star(n) so that it will print out n consecutive
stars in a row.
- You may have to change the "end" string of print()
to be an empty string.
- Don't forget to add a statement "print()" at the end of your
program to make the output more elegant.
M = ? 6
******
- Define a functin star(m,n) so that it will print out m rows, each
row consisting of n stars.
- Hint: You need to place a definite loop inside another definite
loop.
M = ? 3
N = ? 7
*******
*******
*******
- (Advanced) Define a function triangle(n) so that it will print out n rows.
The 1st row consists of 1 star. The 2nd row consists of 2 stars.
The 3rd row consists of 3 stars. The nth row consists of n stars.
N = ? 5
*
**
***
****
*****