Python Forum
[split] Homework help
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[split] Homework help
#2
It's not good idea to use 'Dict' as variable name. It's too similar to built-in 'dict'. This name also have no hint what dictionary it is. Maybe something along this - 'contar_palabras' (pardon my spanish :-))

If I understand correctly then your problem is that last words in sentence which have punctuation at end with no space are counted as different words. You should get rid of punctuation, either using your own punctuation list (like '!.?,:;"') or using string.punctuation
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply


Messages In This Thread
[split] Homework help - by JayBand - Sep-25-2019, 08:49 PM
RE: [split] Homework help - by perfringo - Sep-26-2019, 05:06 AM
RE: [split] Homework help - by buran - Sep-26-2019, 06:48 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020