MJP

architect • coder • strategist • musician • educator

Count Punctuation

Count Punctuation

Instructions

Implement a recursive function, count_punctuation, that counts the amount of punctuation in a string.

For this function, punctuation counts as [",", ".", "!", "?"]

Example

count_punctuation("") # 0
count_punctuation("!") # 1
count_punctuation("What, me?") # 2
count_punctuation("Ready? Set... Go!") # 5