发布网友 发布时间:2022-04-23 00:55
共1个回答
热心网友 时间:2022-05-10 11:07
def get_size():
n=int(input ("Enter a number between 3 and 8: "))
while (n < 3) or (n > 8):
n = int(input("\tInvalid entry - try again: "))
return n
def get_char():
c =input("Enter a character: ")
while len(c) != 1:
c =input("\tInvalid entry - try again: ")
return c
def print_box():
number = get_size()
c = get_char()
for index in range (number-1):
print(c, end="")
print (c)
for row in range (2,number):
print(c,end="")
for index in range(number-2):
print(" ", end = "")
print(c)
for index in range (number):
print(c, end="")
return None