Ad

Thursday, December 7, 2017

String Manipulation in Python - Technical Interview with Python for Bootcamp Graduates

What would happen if you try to split an empty string? '' Will it throw an error?

''.split()

Answer:

-----
No. It will return an empty Python list array.
-----

What would happen if you try to join an empty array? [] Will it throw an error?

''.join([])

Answer:

-----
No. It will return an empty string ''.
-----


No comments:

Post a Comment

Trie - Insert and Search | GeeksforGeeks

Implement Trie.