There are a few issues here...
As Vasili mentioned, the newline character should be
\n
, not/n
str.strip()
does not modify the string directly. It returns a copy of the modified string. So it should beWhole = Whole.strip('\n')
str.strip()
remove leading and trailing characters. In your case, you wanted to remove the newline characters which are in the middle of the string. So you should usestr.replace()
instead, e.g.Whole = Whole.replace('\n', '')