Instructions (taken from ebook version not sure if text is the same):
Take the string "Where now? Who now? When now?" and call a method that returns a list that looks like: [" Where now?", "Who now?", "When now?"].
Your Solution:
lst = "Where now? Who now? When now?".split("?")
print(lst)
['Where now', ' Who now', ' When now', '']
This is the second occurrence of this type of problem. You asked for the solution with the '?' but I couldn't figure out a way to do that. Even your solution comes out with the same solution that I came up with. With that being the case, is there a way that you can come up with a solution that can split at ("?" + 1 character)? Splitting at " " will just make a huge list. Thanks!
Instructions (taken from ebook version not sure if text is the same):
Your Solution: lst = "Where now? Who now? When now?".split("?") print(lst)
This is the second occurrence of this type of problem. You asked for the solution with the '?' but I couldn't figure out a way to do that. Even your solution comes out with the same solution that I came up with. With that being the case, is there a way that you can come up with a solution that can split at ("?" + 1 character)? Splitting at " " will just make a huge list. Thanks!