Epython Lab
6.11K subscribers
680 photos
31 videos
104 files
1.31K links
Welcome to Epython Lab, where you can get resources to learn, one-on-one trainings on machine learning, business analytics, and Python, and solutions for business problems.

Buy ads: https://telega.io/c/epythonlab
Download Telegram
#Q1

#DataScience #Python #String

You can split up your string into separate substrings according to the presence of whitespace. This creates a list of strings, where a 'list' is simply a container for the strings. Lists are Python objects in thier own right and we will discuss further in the next time.

In the other way we can also combine a list of strings and create a single long text.

Q: what functions we use to separate and combine strings? Explain using examples.

Post your solution @pythonEthBot

#PreventCOVID19
#Solution for #Q1 by @oneyedking

split() function used to split string to substrings
Example :
Str = "coding with python"
Str.split(' ')
Result : "coding", "with", "python"

By @met_asploit

There are built in func
split and join
while split is used to separate a string and create a list , join is used to combine list and create a string
>>> a = ['a' , 'b' , 'c' , 'd']
>>>' '.join(a)
'a b c'
>>>b = 'hello how are you'
>>>b.split(' ')
['hello' , 'how' , 'are' , 'you']