I'm trying to divide particular length into sections and print section division_result times in row. The rest is divided by 2 and both placed at the beginning and the end of the list.
For now I have this:
section = 180
length_to_divide: int = 2150
interject = ' X '
division_result = length_to_divide / section
sides = (length_to_divide % section) / 2
whole = str(section).split() * int(division_result)
print(sides, whole, sides)
with the output
85.0 ['180', '180', '180', '180', '180', '180', '180', '180', '180', '180', '180'] 85.0
Is there any way to print list items in row, but instead comma split them by interject = ' X ' in my case, I'd like to have an output like:
85.0 X 180 X 180 X 180 X 180 X 180 X 180 X 180 X 180 X 180 X 180 X 180 X 85.0