Computer Science, asked by simpygujral, 1 year ago

Give the output of the following snippet: Name= “Split-this-string” Name.split(“-”) a. [“Split”, “this”, “string”] b. Split, this, string c. [“Split-“, “this-“, “string”] d. Split this string

Answers

Answered by emspsaheenpdh14w
0

a. [“Split”, “this”, “string”]

Answered by phillipinestest
1

The output of the given code of the following snippet Name= “Split-this-string” Name.split(“-”) is [“Split”, “this”, “string”]. Here the split occurs where the separator is specified. Here in the code, the split happens when there is a separator in the string ' - '. When there is no separator specified in the code, there is no split in the text and the split shows the entire string as the output.

Similar questions