Reference no: EM132355638
Question
Add a new function called print_box to your program. print_box will manage the other three functions by calling:
1. get_size to get a number from the user and
2. get_char to get a character from the user and then use those values as arguments to call:
3. print_line multiple times to print a properly sized hollow box drawn with the character selected.
You already have the first 3 functions written by you , here they are:
def print_line(outer, mid, dom):
print(outer, end ="")
for index in range(dom-2):
print(mid, end = "")
print(outer)
return None
def get_size(number):
number=int(input("Enter a number between 3 and 8: "))
while (number < 3) or (number > 8 ):
number=int(input("tInvalid entry - try again: "))
return number
def get_char(userInput):
while True:
userInput = input("enter only one character: ")
while len(userInput) != 1:
userInput=input("Invalid entry - try again: ")
return userInput
You was thinking it was going to be something like def print_box(get_char,get_size,print_line) but you really don't know where to go on afterwards.
Not really fond of calling a previous functions to another function.