Python 3.3.2 - Calculator 7 Segment Display w/ Width
I need to write a program to make a seven segment display. It will work
like this:
def numbers(number, width):
# Code to make number
A typical output could look something like this:
numbers(100, 2)
-- --
| | | | |
| | | | |
| | | | |
| | | | |
-- --
numbers(24, 1)
-
| | |
- -
| |
-
numbers(1234567890, 1)
- - - - - - - -
| | | | | | | | | | | | | |
- - - - - - -
| | | | | | | | | | | | |
- - - - - - -
numbers(8453, 3)
--- --- ---
| | | | | |
| | | | | |
| | | | | |
--- --- --- ---
| | | | |
| | | | |
| | | | |
--- --- ---
Anyway, those are a few examples (which took quite a while to type, mind
you). I know I can use things such as '-' * number and such, but it is
just frustrating as I cannot figure it out! I feel like I should be using
classes or something, but I can't quite put my finger on it.
Thank you.
No comments:
Post a Comment