After some manipulations with a large list, I get the data I need in this form:
data print (data): TABLE CHAIR SOFA WALL Data types:
<class 'str'> <class 'str'> <class 'str'> <class 'str'> You just need to make a list of them:
mylist [TABLE, CHAIR, SOFA, WALL] Why do I have
mylist = [h for h in data] and
mylist = [] mylist.append (data) They do not give the desired result, but make lists of each word separately, but inside them break each letter and separate them with commas! How to make a normal list with the words (str) inside?
print(repr(data)) 'TABLE' 'CHAIR' 'SOFA' 'WALL'
print(repr(data))- andreymalprint(repr(data))cannot in any way output something, then you wrote it. Show screenshot of output - andreymalstris not a few words, it is an array of characters, therefore either data is not of type str, or you do not agree with something.reprline cannot produce a result in several lines (four, as you have shown) - repr always gives exactly one line without hyphenation. Show a screenshot of theprint(repr(data))output, but rather give a minimal reproducible example , because nothing is clear at all. - andreymal