Is there a simple way to remove multiple spaces in a string?
import res = "The fox jumped over the log."re.sub("\s\s+" , " ", s)
or
re.sub("\s\s+", " ", s)
since the space before comma is listed as a pet peeve in PEPĀ 8, as mentioned by user Martin Thoma in the comments.