What command in python can be used to make the string ST = "WORK,IS,DONE" a list ["WORK","IS","DONE"]?
I am trying this but its not working
ST = txt.split(",")
print(ST)
Libra
2,6051 gold badge11 silver badges29 bronze badges
1 Answer 1
Looks like you have the string defined under ST and not txt, which appears to be the issue.
st = "WORK,IS,DONE"
st = st.split(sep=",")
print(st)
Sign up to request clarification or add additional context in comments.
Comments
lang-py
txtbut if your variableSTholds these words then you shouldST.split(',')