Learning Python

If anyone would have told me a year or so again that I will go back to learning Python and actually find it easy to learn as it is advertised, I would have told them that they are mad. Hell, even one month ago I would have provided them the same response, but here I am now actually putting time in learning this OPP language and actually understanding and finding it an interesting programming language.

It is true that if you start learning Python after learning and knowing the formatting that other languages have it might look strange not having {} when you start an if statement, function etc, or ; at the end of a command, but if you actually pay attention you will understand it.

Same happened to me when I started learning it at the beginning of the month. But what I did, is that I decided to put my head into this and learn it, by actually learning two things at once.

What I mean by this is that while I learn Python, I do this by building a blockchain application, as I wanted to see first hand how a blockchain functions.

So far, I have created the basic app, and have built the basic functionality to it.

How it works:

A user will have to start the script (at this time), as no UI is present for now, and they will be prompted to enter one of the options available.

Options that the user can select:

1: Add a new transaction value – They can enter a transaction to be sent (This can not be done as a first option as the transaction will fail because the user has 0 funds)
2: Mine a new block – User will first need to mine a block in order to be rewarded with coins to spend
3: Output the blockchain blocks – Returns the blocks
4: Output participants – Returns the Senders and Recipients of the coins.
5: Check transaction validity – This was mainly to see if the chain functions – Redundant for the user
h: Manipulate the chain – Hack attempt of the chain. Validation will fail if this is attempted and hacking will fail
e: Exit – Option to exit the code.

To do:

Ad a more advanced hash system. At this time the hashing system simply concatenates the values of the block and that will be checked.

  • Further improve the code
  • Remove redundant options
  • Add an UI – Most likely I might be using Flask to put it on the internet.

Leave a Reply

Your email address will not be published. Required fields are marked *