Counting Letters in Python [part 1]

in spanish •  8 years ago  (edited)

Counting letters is widely used in different branches of science, which is why it is of much interest today in Dia.

For example, we can usually see it in Cryptography or right now with the use of social networks in lexicology.

Lexicology is the study of a person's lexicon.

With data from Social Networks we can know how educated is an aspirant to work in our company, so be careful with what we write in social networks.

Although I wrote some loose entries in my Blog stickybitshell.wordpress.com about letters counters and words in plain text. As well as in Social Networks such as Twitter, today I told myself why not group these entries and give them more meanings for the formation of other interested people or just out of curiosity who want to see that they say their comments of them on Twitter or Facebook, Good here the first entry.

I'm not going to limit myself to Plain Text if not that my goal is to read PDFs because it makes great sense today to look for anything in a book

If that does google or grep on the Linux system but to entertain us and know how many words there are in a book and how many are "this" for example.

To begin with the beginning, we are going to enter a string of characters or phrase or simply copy this post and paste it in the console to later see the number of repetitions of the letters.

A I forgot if you have not installed Python that you are waiting, it is easy to work:

We can make a couple of improvements to show the most interesting output, such as create a table and show the letter and next to how many times it is repeated, then the output, for the next entry tomorrow I am upgraded. Here the output of the Program:

Using Python Dictionaries to count how many times a letter appears in a string, we could also create a program to count how many times a word appears or the concatenation of 2 words in a text.

For example this is done a lot in the Bible we could count how many times a Greek word appears in a Greek bible or any language, as I said at the beginning it is possible to know where a text is only by repeating the letters.

To finish the homework, which is the letter in Spanish that is repeated more times, take this line and find out;

Until next time, may God bless your lives greatly.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Hi. Interesting article. I love python. Anyway, I'll recomend you to remove the tag #spanish since the article is written in english.

  ·  8 years ago (edited)

There seems I did not realize, is that it is a translation of the original in Spanish, thank you very much for the observation.
And well I like to write and I almost always do Python.

It seems that I did not realize, is that it is a translation of the original in Spanish, many thanks for the observation.

And well I like to write and I almost always do Python.

In the end I can not remove the category, I'll write some more.

Here the link: https://steemit.com/programming/@sethroot/counting-letters-in-python-with-table-part-1-1-prettytable