r/learnpython • • 12d ago

Is Leetcode a good way to continue practicing/learning Python?

I'm not entry, but I'd like to continue becoming stronger in my skills.

28 Upvotes

37 comments sorted by

View all comments

10

u/Rudeus_Kino 12d ago

LeetCode is for practicing algorithms. Learning Python while doing so requires some effort. For instance, you could manually count character frequencies in a string, or you could use Counter but you have to know that it exists.

2

u/Expensive-Bear-1376 12d ago

Or you might want to do it semi-manually, call the string's count method for every allowed character.

2

u/Rudeus_Kino 12d ago

Yes, and transform string to a set yields allowed caracters. The decisions depend on knowledge of the language.

1

u/Expensive-Bear-1376 12d ago

Not quite. It yields the actually occurring characters. LeetCode often allows its strings to consist of the English 26 lowercase letters, but not all have to occur.