Last answered:

20 Apr 2022

Posted on:

20 Apr 2022

3

Resolved: in line 107, I think it should be: ... .get(letter.lower(),0)+1. Is that's correct?

In line 107, I think it should be:  ... .get(letter.lower(),0)+1. Is that's correct?. Otherwise, it will just keep updating the count of a letter and force it to 1 whenever the uppercase appears.

1 answers ( 1 marked as helpful)
Instructor
Posted on:

20 Apr 2022

2

Hey Mohammed,

Thank you very much for your question!

You are correct! The line should indeed read

... .get(letter.lower(), 0) + 1

Implementing it in this way yields the same result as the one obtained when using the Counter class, shown a few lectures later. And that's how it should be.

Kind regards,
365 Hristina

Submit an answer