Answers for "python list strip"

0

how to strip a list in python

list1 = ["a  ", "  b ", " c"]

[i.strip() for i in list1] # ['a', 'b', 'c']
Posted by: Guest on August-23-2020
1

strip function in python

lol = '     lol   '
print(lol)
# normal output =      lol   
lol = '     lol    ' 
print(lol.strip())
# strip output = lol
# Cool right
Posted by: Guest on May-27-2021
1

python strip()

a = "  smurf   "

a = a.strip()
#remove space at begining and end of string
print(a)
#smurf
Posted by: Guest on January-19-2021

Python Answers by Framework

Browse Popular Code Answers by Language