Homework Assignment Number 6
- Finish Reading Chapter 4
- Write function that will make a rectangle out consisting of
any character:
- Make_character_rectangle(height, width, char)
- Should make height rows of width instances of char
- For example, if height = 5 and width = 3, and char = '*', a 5
X 3 rectangle of asterisks would be created.
- Write a function that makes a parallelogram of characters in a
similar way
- Make_character_parallelogram(height, width, char)
- The first line of the parallelogram should be height-1 spaces
from the left margin, the second line should be height-2 spaces, and so
on until the last line where there are 0 spaces before the first '*'
- For example, the
following would be produced by the
command:
character_parallelogram(5,6,'*')
- ******
- ******
- ******
- ******
- ******
- Write a timer that prints out every one tenth of a second. It
should use the format: Hours:Minutes:Seconds.fraction
- For example, 00:00:00.0, 00:00:00.1, 00:00:00.2, etc.
- Clarification: use the module time
and the function time.sleep
- time.sleep(1) ## will pause for one second
Grading Criteria
- Do your programs work?
- Do your programs answer the questions the way they are stated?
- Is your code clear?
- Do you use good variable names, good function names and
comments when necessary?
- When parts of your program repeat, do you encapsulate these as
functions and then call those functions?
- Is your code elegant, clever or creative?