QUIZ 6
COMP9021 PRINCIPLES OF PROGRAMMING
$ python3 quiz_6.py
Enter three positive integers: 0 1 2
Here is the grid that has been generated:
1 1
0 1
$ python3 quiz_6.py
Enter three positive integers: 0 1 3
Here is the grid that has been generated:
1 1 0
1 1 1
1 1 1
For steps of size 2, we have:
2 stairs with 1 step
$ python3 quiz_6.py
Enter three positive integers: 0 3 9
Here is the grid that has been generated:
1 1 0 1 1 1 1 1 1
1 1 1 1 0 1 1 1 0
0 1 1 0 1 1 1 1 1
1 1 0 0 0 1 0 1 1
1 1 0 1 1 1 1 1 0
0 1 1 0 1 1 0 1 1
1 1 0 1 1 1 1 1 1
1 0 1 1 0 0 1 1 0
0 1 1 1 1 1 1 1 1
For steps of size 2, we have:
5 stairs with 1 step
1 stair with 2 steps
1 stair with 3 steps
1 stair with 4 steps
For steps of size 3, we have:
4 stairs with 1 step
Date: Trimester 1, 2023.
2 COMP9021 PRINCIPLES OF PROGRAMMING
$ python3 quiz_6.py
Enter three positive integers: 0 3 7
Here is the grid that has been generated:
1 1 0 1 1 1 1
1 1 1 1 1 1 0
1 1 1 0 0 1 1
0 1 1 1 1 1 1
1 0 0 0 1 0 1
1 1 1 0 1 1 1
1 1 0 0 1 1 0
For steps of size 2, we have:
2 stairs with 1 step
2 stairs with 2 steps
For steps of size 3, we have:
1 stair with 2 steps
$ python3 quiz_6.py
Enter three positive integers: 0 4 8
Here is the grid that has been generated:
1 1 0 1 1 1 1 1
1 1 1 1 1 1 1 1
0 1 1 1 1 1 1 0
0 1 1 1 0 1 1 1
1 1 1 1 1 1 1 0
1 0 0 1 0 1 1 1
1 1 0 1 1 1 1 1
1 1 0 0 1 1 1 0
For steps of size 2, we have:
7 stairs with 1 step
3 stairs with 2 steps
2 stairs with 3 steps
For steps of size 3, we have:
2 stairs with 1 step
1 stair with 2 steps
For steps of size 4, we have:
1 stair with 1 step
QUIZ 6 3
$ python3 quiz_6.py
Enter three positive integers: 0 5 9
Here is the grid that has been generated:
1 1 0 1 1 1 1 1 1
1 1 1 1 1 1 1 0 1
1 1 1 1 1 1 0 1 0
1 1 1 1 0 1 1 1 1
1 1 1 1 1 1 1 0 1
0 0 1 1 1 1 1 0 1
1 1 1 1 1 1 0 1 1
1 1 1 1 1 0 0 1 1
1 0 1 1 1 1 0 1 1
For steps of size 2, we have:
4 stairs with 1 step
5 stairs with 2 steps
1 stair with 3 steps
2 stairs with 4 steps
For steps of size 3, we have:
9 stairs with 1 step
For steps of size 4, we have:
2 stairs with 1 step