worked on stuff
This commit is contained in:
parent
9e19e4d418
commit
1e1e8f1f03
@ -1,2 +1,12 @@
|
|||||||
def titlecase(string, exceptions):
|
def titlecase(string, exceptions):
|
||||||
pass
|
words = string.lower().split(' ')
|
||||||
|
new_words = []
|
||||||
|
for word in words:
|
||||||
|
if word in exceptions:
|
||||||
|
new_words.append(word)
|
||||||
|
else:
|
||||||
|
new_words.append(word.capitalize())
|
||||||
|
|
||||||
|
return ' '.join(new_words)
|
||||||
|
|
||||||
|
print(titlecase('the quick brown fox jumps over the lazy dog', ['jumps', 'the', 'over']))
|
Loading…
x
Reference in New Issue
Block a user