Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribedimage text in transcribedimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Query Formulation And Administration Using Oracle And PostgreSQL

Authors: Michael Mannino

8th Edition

1948426951, 978-1948426954

More Books

Students also viewed these Databases questions