Give an example for join() and split() funcitons
Answer / Km Sonit
The `join()` function in Python is used to join the elements of an iterable into a string. The `split()` function splits a string into parts using a specified separator and returns them as a list. Here's an example: `my_list = ['Hello', 'World']`, then `result = ' '.join(my_list)` gives 'Hello World', and `my_string = 'Hello World'`, then `my_list = my_string.split(' ')` results in ['Hello', 'World'].
| Is This Answer Correct ? | 0 Yes | 0 No |
What does len () do in python?
Explain the difference between a list and the tuple?
What does map function in python do?
What are the rules for legal python names?
How do you avoid cyclic imports without resorting to imports in functions?
What is range() in python? Give an example to explain it.
What is long in python?
Are tuples hashable?
What is the purpose of uuid?
Is java better than python?
What is python's slice notation?
Explain about the programming language python?