How to remove spaces from a string in Python?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do u want this job?

517


Explain a few methods to implement functionally oriented programming in python?

551


What are the types of variables in python?

517


Why are tuples immutable?

513


What is python lint?

512






Is r similar to python?

529


Is python based on c?

545


What is difference between list and set in python?

514


What happens when you execute python == python?

577


When would you use a break statement in a for loop?

531


What are its benefits of flask?

526


Is vs in python?

520


is Python similar to ruby?

546


Can python be used for web client and web server side programming? And which one is best suited to python?

498


What is a super constructor?

595