How to remove spaces from a string in Python?



How to remove spaces from a string in Python?..

Answer / nashiinformaticssolutions

Python's strip() and replace() functions can be used to eliminate spaces from a string. The replace() function eliminates all of the white spaces in the string, while the strip() function eliminates the leading and following white spaces.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

What is self in python constructor?

0 Answers  


How do you create a database in python?

0 Answers  


Is python a procedural language?

0 Answers  


What is *args and **kwargs?

0 Answers  


What is a metaclass in Python?

0 Answers  






Explain the difference between append vs extend in list?

0 Answers  


How do you write a function in python 3?

0 Answers  


What is the difference between ‘match’ and ‘search’ in python?

0 Answers  


Why python is so popular?

0 Answers  


What are the rules for a local and global variable in python?

0 Answers  


Is there a way to remove the last object from a list?

0 Answers  


Is python slower than c?

0 Answers  


Categories