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

F1 Score - Machine Learning

F1 Score is an useful metric of classification models rather than regression machine learning models. It is an useful metrics for models tha...