Jul-17-2018, 04:47 AM
I would guess that you intended
Alternatively, you can take the sum of all the individual words produced by
chars = len(sentence.replace("",""))to be
chars = len(sentence.replace(" ",""))(Note the extra character in the second line.)
Alternatively, you can take the sum of all the individual words produced by
sentence.split()
, to get the number of characters.