loading...

re: Daily Challenge #39 - Virus VIEW POST

FULL DISCUSSION
 

Python

def proofread(string):
    if string.rstrip()[:-1].count('.') == 0:    return string.lower().replace('ie','ei').capitalize()
    string= '. '.join([i.lower().replace('ie', 'ei').lstrip().capitalize() for i in string.split('.')])
    if string[-1] == ' ':   return string[:-1]
    else:   return string
code of conduct - report abuse