CSC111 Homework 2 2011
--D. Thiebaut 13:29, 20 September 2011 (EDT)
Contents
Problem #1
Problem #2
I have written a Python program and have executed it several times in Idle. I'm including below the output of the program captured from the shell window:
>>> ================================ RESTART ================================
>>> ================================ RESTART ================================
>>>
How many lines do you want printed? 0
>>> ================================ RESTART ================================
>>>
How many lines do you want printed? 1
*
>>> ================================ RESTART ================================
>>>
How many lines do you want printed? 2
*
*... **
>>> ================================ RESTART ================================
>>>
How many lines do you want printed? 3
*
*... **
**...... -***
>>> ================================ RESTART ================================
>>>
How many lines do you want printed? 10
*
*... **
**...... -***
***......... --****
****............ ---*****
*****............... ----******
******.................. -----*******
*******..................... ------********
********........................ -------*********
*********........................... --------**********
>>>
Your assignment is to write a program that behaves exactly, or as close to the program I have written as possible. In particular, notice that when I entered 0, it didn't print anything. When I entered 1, it printed one line. When I entered 2 it printed 2 lines. 3, 3 lines; 10, 10 lines.
You do not have to worry about the extra space at the beginning of the first line. Your program will be be good even if it prints the first star of the first line in the left most column.