Question: Write a function called 'return_list that takes a string as a parameter and returns a list of words in the string. Words are entities that



Write a function called 'return_list that takes a string as a parameter and returns a list of words in the string. Words" are entities that are seperated by either commas or spaces). In case the string contains neither commas nor spaces, the string will be returned without any manipulation. Note: We are not testing for the case where both commas and spaces are present in the string so feel free to ignore that. Example Input: Enter the string: this is a string Output: [this, is, a, string1 Input: Enter the string: Pranshu,Enbody,Alireza Output: ['Pranshu, Enbody, Alireza] Python 3.5 Code ##function 1 3 def main: 4 'return-list ' goes here the_string input("Enter the string:") result - return_list(the_string) print(result) 7 8 main() Expand
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
