id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

david.white@denison.edu cs112fall2015 > sentences
prev  |  next  |  chance

Write a function sentences(text) that returns the number of sentences in the string text. A sentence may end with a period, question mark, or exclamation point. It may also end with multiple punctuation marks, such as ’!!!’ or ’?!’. You may assume the string text has length at least 1 and does not start with punctuation.


sentences('Am I a sentence?!? Cut me do I not bleed!?') → 2
sentences('This. Is. Terrible. Grammar! Right?') → 5
sentences('A sentence without punctuation is no sentence at all') → 0

...Save, Compile, Run (ctrl-enter)

def sentences(text):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Copyright Nick Parlante 2017 - privacy