Python Code Review Challenge 1: Fix the Error

preview_player
Показать описание
Hello Everyone,

Today we are starting on the Pro Code Review Challenges. Our job is to fix the code errors. This coding challenge is from the Data In motion Platform. Link is posted below.

Please leave a comment with any tips or let me know how you would have approached this problem.

Thanks for watching!

My LinkedIn:
/ shantel-williams-software-developer

Data In Motion is a comprehensive e-learning platform backed by the best online support community.

Рекомендации по теме
Комментарии
Автор

Another possible solution would be to change line 13 to

from collections import defaultdict
word_counts = defaultdict(lambda: 0)

seppeljordan
Автор

I was able to identify the error, but your solution is less verbose than mine. I always forget about the get method for some reason so I end up handling it with a try except on the key error. Need to work on that lol.

codedog
Автор

I wish I could hear you better but the music is way too loud

elmirach
welcome to shbcf.ru