there are lines and in line there are spaces, so i want to get rid of spaces to left just strings.
spaces like '', '', '' so which code should i use to delete spaces?
Thnks
st = " with, or, without , spaces ";
st = st.replace(" ","")
print(st)
with,or,without,spaces
you could use
sys.stdout.write("something")
sys.stdout.write("without")
sys.stdout.write("spaces")
instead of
print "something", "without", "spaces"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.