CSC111 Exercises on nested for-loops
--D. Thiebaut (talk) 10:32, 24 February 2014 (EST)
Exercise 1
This is taken from Section 4.7 in the textbook:
for i in range(4):
for j in range( i+1 ):
print( "*", end="" )
print()
The output is
*
**
***
****
- Question
- Modify the program so that it outputs this pattern
****
***
**
*
Exercise 2
Modify the program so that it outputs this pattern:
*
**
***
****