If given a sentence with a list of multiple statements, separate them and make them their own sentence
For example
The input would be:
“I need milk, eggs, and cheese from the store.”
The output would be:
“I need milk from the store.
I need eggs from the store.
I need cheese from the store.”
My code right now
string
text = “I shall need milk, eggs, and cheese from the store.”
if there is a shall statement, continue
if “shall” in text:
# use split function
text = text.split(‘,’)
# print each argument in a different line
for i in text:
print(i)
Ashlyn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.