I'm stuck with an exercise which asks me to design a door mat of NxM
size, in which N
is an odd number and M
is equal to N*3
, in the way you can see there with the full explanation of the exercise.
To do that I've written the following code:
door_mat_length = int(input())
door_mat_width = door_mat_length * 3
string = '.|.'
welcome = 'WELCOME'
for i in range(1, int((door_mat_length + 1) / 2)):
string_multiplier = string * (i + (i - 1))
print(string_multiplier.center(door_mat_width, '-'))
print(welcome.center(door_mat_width, '-'))
for i in range(int((door_mat_length + 1) / 2), 1):
string_multiplier = string * (i + (i - 1))
print(string_multiplier.center(door_mat_width, '-'))
But the program stops at the print command in the middle, without iterating over the next fuction. How can I resolve this? Thanks in advance.