Header Ads

Responsive Ads Here

Strip Methods

 Strip Methods



name1 = "         Xtra         "
name2 = "Coding"

print(name1 + name2)
print(name1.lstrip() + name2)  # Removes left side spaces
print(name1.rstrip() + name2)  # Removes right side spaces
print(name1.strip() + name2)   # Removes both side spaces



Powered by Blogger.