import textwrap
def wrap(string, max_width):
i = textwrap.wrap(string, width=max_width)
print(i)
z = print(*i, sep='\n')
return z
string, max_width = 'ABCFSAODJIUOHFWRQIOJAJ', 4
result = wrap(string, max_width)
print(result)
I am trying to write a code that separates a string in a list, and then prints out each part of the list as a separate line. It works fine until the last bit, where it still attaches None after running the code. I have tried all sorts of ways, but I cannot seem to force my definition to avoid the None
.