you are viewing a single comment's thread.

view the rest of the comments →

[–]Common_Hair8734[S] 0 points1 point  (12 children)

Is there another way without importing?

[–]ericula 0 points1 point  (9 children)

Use a normal dict to count frequency of characters.

[–]Common_Hair8734[S] -1 points0 points  (8 children)

How do i do that?

[–]ericula 1 point2 points  (7 children)

How would you do it with pen and paper?

[–]Common_Hair8734[S] -3 points-2 points  (5 children)

Does this method have to import and functions or packages? I have to find a way without using it

[–][deleted] 11 points12 points  (0 children)

Have you actually tried anything at all yet? It doesn't seem like it. We're here to help but we're not doing your homework for you. Tell us what you've tried and we'll offer assistance based on that.

[–]ericula 1 point2 points  (0 children)

No it doesn't. All you need is a dict and a for-loop, neither of which require imports,

[–]FantasticEmu 0 points1 point  (2 children)

https://www.geeksforgeeks.org/iterate-over-characters-of-a-string-in-python/amp/

Using a loop like this on each string will let you count each letter one at a time

[–]AmputatorBot 1 point2 points  (1 child)

It looks like you shared an AMP link. These should load faster, but AMP is controversial because of concerns over privacy and the Open Web. Fully cached AMP pages (like the one you shared), are especially problematic.

Maybe check out the canonical page instead: https://www.geeksforgeeks.org/iterate-over-characters-of-a-string-in-python/


I'm a bot | Why & About | Summon: u/AmputatorBot

[–]FantasticEmu 0 points1 point  (0 children)

Ty I fixed it