106k views
1 vote
For loops and user-defined functions

You have been given three functions in the Python file digitalclock.py. For this problem, you will import functions from digitalclock.py to print patterns that look like
digits on a clock. Write a series of functions that will call functions from to print the digits 0-9 in block format
with fixed width 5 and fixed height 5 by calling functions from digitalclock.py. Your
functions should take in a single argument that defines the character that will be used to
print the number.
The code for each digit function should not be more than five lines in length.
Use input, output, processing notation to comment on each function.
Dot notation should be used to call the functions.
Hint: use help() to look up docstring information about digitclock functions.
Remember to import digitclock before calling help().
Below are some examples of the functions being called in IDLE's interactive mode.
Underlined text indicates user input.
Example 1
>>> number5("")
8
Example 2
>>> number6("#")
Example 3
>>> number? ("S")
S
S

1 Answer

1 vote

Final answer:

To print digits in a block format, write functions that call functions from digitalclock.py.

Step-by-step explanation:

The subject of this question is Computers and Technology. The student is asked to write a series of functions in Python that will call functions from digitalclock.py to print the digits 0-9 in a block format with a fixed width and height. The functions should take in a single argument that defines the character to be used. The code for each digit function should not exceed five lines.

User Samshull
by
7.7k points