-
-
Notifications
You must be signed in to change notification settings - Fork 49.6k
Closed
Description
• This question concerns the processing of lists and strings.
• Create a list of strings ls word as follows.
- Write a loop and in the loop, prompt the user to enter a line of text from the console.
- Read the input text into a string s.
- Split the string s and set ls word to the resulting list.
- Use the default action to perform the split, i.e. items are separated by spaces.
- If you do your work correctly, ls word will contain strings without whitespaces.
- Break out of the loop if the list ls word has at least four elements, else prompt again
Am I supposed to have my list without any whitespace? Prompt 3 & 4 seem to contradict. Can someone's explain this please?
(Professor won't explain)
Thank you!
Metadata
Metadata
Assignees
Labels
No labels