how to add each word in this structure to an array?
I want to remove the extra quotations an (\r\n)
for item in most_common_list:
print(item[0])
how to add each word in this structure to an array?
I want to remove the extra quotations an (\r\n)
for item in most_common_list:
print(item[0])
Use the strip() method on your strings to remove whitespace (includes \r
and \n
)
If it is the case that you have literal \r
and \n
strings in your text (as opposed to carriage return and newline characters), you should figure out why these are being generated and put into your most_common_lost
and fix it at the source. It seems highly likely that they should not be a part of these strings.