Coding Quiz - Splitting Strings
In this coding quiz, you will write a function that uses Python's split
method to separate and process a string.
Create a program that accepts a single string
and a delimiter
(the character used as the basis for splitting the string) from the user, divides the string based on the delimiter, and returns the result as a list.
Parameter Format
def solution(text, delimiter): return # Write your code here
Constraints
-
The input string can contain spaces, special characters, numbers, and alphabets.
-
The delimiter is a string with a length of 1 or more.
Input and Output Example
-
Input: string -
"hello,world,python"
, delimiter -","
-
Output:
["hello", "world", "python"]
Guidelines
AI Tutor
Publish
Design
Upload
Notes
Favorites
Help