Python Tutorial for Beginners – Learn Python by Building a Blockchain & Cryptocurrency
- January 1, 2024
- Posted by: MainInstructor
- Category: BASIC C Data Science Go Java JavaScript Node PHP Python Swift Web Development
Video Title: Python Tutorial for Beginners – Learn Python by Building a Blockchain & Cryptocurrency
Welcome I got a new course and it’s called learn Python by building a blockchain I guess the title speaks for itself it’s a Python course you will learn Python from scratch no prerequisites required you will learn all the core syntax features like list comprehensions using more complex data structures like tuples
Or dictionaries you will learn object-oriented programming with Python by using classes and inheritance you will learn how to spin up a webserver and handle incoming requests with flask you will learn how to send requests how to work with files and so much more so really a fertile Python course that
Introduces you to the language and it does so by building a real cool course project a basic blockchain and your own cryptocurrency now that sounds very fancy well why did I choose that course project well I chose to build a blockchain because it turns out that we actually can gradually enhance the
Blockchain start very basic and then add more and more core features off the blockchain technology as we learn more about Python so it’s a really cool project that allows you to apply your newly gained knowledge and build something realistic that’s always important to me I want to build course
Projects that are connected to something you know from real life that aren’t too abstract now the blockchain on the other end is kind of abstract you hear about that technology a lot and I’d argue that most people don’t really know how it works and that’s another cool thing
About the course whilst it is not a blockchain course a it’s not about the blockchain only it’s about Python but whilst that is the case you will learn a lot about the blockchain there you will learn about the core concepts behind it and therefore you hopefully understand
Their technology a bit better too so it really has these two parts Python and the blockchain two very popular topics now connected in one course which hopefully allows you to learn a lot about Python and also learn a bit about the blockchain whilst you’re going through it I’d be more than happy to
Welcome you in the course if you are interested you’ll find a link with a nice discount in the video description and I also attached a couple of lectures at the end of this video to allow you to see if that course is for you as I said
I’d be more than happy to welcome there otherwise see you in all the other videos on this channel bye so what is – – is a programming language which you can use for many different things it’s an extremely powerful easy-to-use and object-oriented programming language now what does this
Mean it’s powerful because it offers good performance it runs on all major operating systems so it doesn’t matter if you’re using Mac Windows or Linux it’ll work on all of these and you can use all of these for this course and it’s extremely versatile to be precise
If we have a look at its versatility we can see that we can use it to build simple scripts or programs running on our desktop with or without an UI that you can use it for web development to run server-side code so code that does something on the server sends back HTML
Documents to your users and stuff like that and another very popular way of using Python is for data science and after this course you will be able to dive into all these different areas because in this course you will learn all the core basics about Python on which all these pillars basically build
Up now what do these pillars mean in detail though well we can build scripts and programs for example build a simple calculator which we execute from our system built-in command line we can write simple utility scripts like clean up scripts or scripts that save some data to files of course we can also
Build complex programs we can add a UI to build real desktop applications this is also something which is relatively easy to do thanks to pythons rich ecosystem another cool Pro argument it has a broad ecosystem of third-party packages and libraries you can add to easily add new functionalities to your
Programs when we have a look at web development we take advantage of that there are a lot of packages that make it easy for us to write server-side code and we’re then able to use PI 4 as a server-side language we’re able to build full stack apps where – takes in
Requests and sends back HTML responses or API applications where we also take requests and send responses but where we interact by just sending data and no HTML code that could be rendered by a browser this allows us to build web applications to which other programs could communicate and this is actually
Also what we’ll dive into in this course but more on that later we can also use frameworks like Django or flask these are these for party libraries I mentioned to make our developers life a lot easier now when we have a look at data science another very popular way of
Using Python there we also have a rich set of third-party programs that make statistical calculations and working with numbers very very easy we also have easy ways of gathering import and cleaning and using data and we can do all kinds of statistical analysis implement machine learning models and
Use them in our apps so Python is extremely versatile and therefore learning it definitely is a great idea and all these areas build up on the basics you’ll learn in this course but Python is not just powerful and versatile it’s also easy to use it has a
Clean and simple syntax no extra fluff added to it it has a batteries included approach which means that just after installing pipe you already got a lot of possibilities of using it you don’t need to import and implement third party packages which you have to download and install separately for many things you
Can’t just use what’s built in that’s really great and it offers a great documentation so if there is something you’re stuck with your you’re not sure you dive into the talks and you get many examples there many ways of learning Python in case you can’t find other
Resources which also help you because as I said there is a rich ecosystem offering many resources to it so that’s pretty amazing and now lastly it’s object orientated that is something which will become clearer once we dive into what this means in a separate module in this course if you already get
Some programming background you’ll be happy to hear that Python users classes inheritance that it supports all these features doesn’t force you to use them but offers the possibility and using these features offers many advantages and that makes the language even more powerful and easy to use in the air
It’s no wonder that python is very popular therefore if we have a look at this graph we see python is extremely popular and it’s gaining popularity surpassing many other languages here and it is of course doing that because it’s easy to learn it’s very versatile and it has this cool ecosystem with many
Third-party packages and therefore it’s highly extensible so learning Python was always a good idea now it’s a better idea than ever before so with that let’s just install Python and write our first simple program with it let’s get started of using Python to use it we have to install it first and that
Is also true if you are on a Mac or Linux there it typically is pre-installed but also typically in an older version so make sure to install the latest one that’s really important and you do install it by visiting python.org and as I said earlier you can use Python
On Mac Linux and windows and you always install it from that page on that page choose downloads and then PI from free dot whatever the latest version is when you’re viewing this in my case it’s free dot 6.5 now it’s automatically giving me the Mac OSX download here if you’re on
Windows you wizard that same page and you simply choose the windows download there it should automatically offer that on both operating systems simply click and the download should start once the download finished simply click the downloaded file and the Installer should open up now on Mac simply click continue
Continue continue agree to the License Agreement choose the place where you want to install it click continue one more time and finally install it now on Windows the steps are basically the same though there are two important things make sure to select this checkbox where you add pipe into your path variable
This is important so that you can later execute it from within your command prompt and then if you choose the manual install option also make sure you install python this pip thing here and all the things you see checked here and also make sure that here the environment
Variable part is checked this is important so that you can conveniently execute Python from within your command prompt later with all that set on both operating systems you can simply hit install and wait for the Installer to finish once it’s dead finish open the terminal on Mac and Linux or
Simply your normal system command prompt on Windows now these are the tools we’ll start with in the course but no worries later in the course we will also use a real editor and work with real files where we write our code and far later into the course we’ll also attach a more
Beautiful UI so this is really just what we’re starting with now I’m using a Mac here that is why you are seeing a terminal but the steps are the exact same if you’re using Windows in the command prompt after installing Python simply enter pioneer as a command directly in the terminal or command
Prompt after you do this you should enter this input mode here you see three greater than signs on the left and this now means you’re now in the Python console so to say this is called the repple and i will come back to what rappelled means in the next module the
Cool thing is here you can now type 5 commands and directly execute them later we will also store them in file so that we can execute a whole file in one go but here we can start simple and you can for example simply enter 2 plus 2 and get back 4
Obviously it’s more than just a simple calculator though so let’s build our first simple program in the next lecture so let’s start building something more exciting than just a simple calculator with this rappelled thing and the steps I show here are shown on Mac but they
Are exactly the same on Windows so what I want to do here is and once you get some input from the user store that in a file and then also open that file and read what we stored there and output it here in this command
Prompt now to get input from the user we can use a function pipe and ships with the input function and you will learn more about all the functions and ships with and what exactly is happening here throughout the course of course input is a function you execute it by typing
Input and then two parenthesis between the parentheses you pass a so-called argument that is something that function will use and the input function is defined by Python it’s built-in to show you the text you’re entering here make sure to use to put a sure marks and then
Wait for the user to enter something so here we could say please enter your name colon and then a blank and if I hit enter you see it’s outputting that text and waiting for me to input something you can tell that it’s waiting by the fact that there are no three greater
Than signs on the left so I can type max here and if I hit enter it’s outputting it below that was the input it received now that’s nice but I want to store that enough file right here we can use an our concept variables something I’ll also
Come back to in this course and we can simply add a variable by typing any name you want like name but you could also type my underscore name anything like that and then an equal sign and then input please enter your name what we’re doing with that is we’re getting the
Input and then we’re storing it in that variable so that we can use it later if I now it enter I can again enter max and now you don’t see max as an output instead now if I type my name here so the name of that variable now we see the
Output this allows us to now use that value as often as we want and now if we want to store it in a file we can call Navarrete function pi from ships with the open function which will open a file for us now I’ll store the result of that
Function in another variable named file so file equals is whatever open returns to us and now open needs two things it needs to know which file to open and how to open it do you want to read do you want to write so I will open a file
Which I’ll name name dot txt and I’ll set mode equal to W 4 right and if that syntax is a bit unclear well just make sure to type it correctly here you will learn what all these things are two different arguments for one function throughout the course no worries but
With that we’re basically telling Pyfrom to open that file and give us right access to it and store that address or that pointer to that file in that file variable if I now it enter we can type file here and this is this strange output which essentially tells us that
It somehow worked and now we can say file dot write my name and this tells Pyfrom to write the content of my name into that file if we now it enter you can ignore that output we can now close that file by calling file dot close with
Parentheses and if you do that let’s quickly navigate into that folder where you’re executing your terminal or command prompt in the finder or Windows Explorer you can tell which path this is running in on windows on the left side of your terminal when you enter python there you should find the path it’s
Currently running in Omak it should simply be in your users main folder there you should find the name dot txt and if you open it you should see the name you entered in there now of course we can do something cooler than just store the value there we can also read
It back into python we can use our file again and call open again name dot txt make sure to don’t forget the quotation marks here and now set the mode to R for read if you now it enter your opening that same file but in read mode and now
You can call file read and if you hit enter it gives you the output of the file here and that was lot of new stuff a lot of things where you might wonder what’s happening here and we’ll learn all these things no worries but I hope this gave you a first
Impression of what you can do with Python and how you can give your computer instructions to execute which in turn allow you to write more complex programs as you can use these instructions and way more other instructions and commands in any combination you want to build any kind
Of program you want and we’ll do this in this course we’ll build a block chain so what is a block chain then you probably heard about blockchains or at least about Bitcoin and cryptocurrencies in general Bitcoin is a cryptocurrency and cryptocurrencies are based on the blockchain technology the blockchain technology can sound very
Abstract but in the end a blockchain is just a distributed data storage so the same copy of the data is kept on multiple machines which are connected and each data storage so on a machine the blockchain is just a chain a list of data stores containers the so called
Blocks which in turn are connected to each other so the order of the blocks matters and every block is read just like a folder on your system which contains some data it’s not technically a folder but you can think of it as one so we got all these folders where each
Folder knows about the folder before it this builds up a chain so the order does matter and then the whole folder holding all these subfolders this is your blockchain and what’s inside a subfolder that’s the data stored in the blockchain and the blockchain is not limited to transactions as you learned the
Blockchain is a data store and a single block in the end can hold any data you want this could be some text this could be a number this could be a program you can execute or as in the case of Bitcoin it can be a list of transactions more on
That in a second we of course don’t just have one block we have multiple blocks in a blockchain and the interesting part is that they know about each other to ensure that you can’t manipulate data in blocks because it’s distributed across multiple machines you want to make sure
That the machines can check each other each block receives a hash or is hashed a hash simply is some long text you could say that is generated automatically from all the parts that make up the block so if you got a block with the data hi I’m in a block and then
Let’s say you have some metadata in that block like a unique ID for every block then you could take both use some hashing algorithm we’ll use a plug-in for that in this course and then it spits out some text and you’ll always get the same text for the
Same inputs and that hash as it is called is stored in the next block so whenever you change the previous block the next block will detect hey the hash I stored doesn’t match the recalculated hash for the updated data because same input yields the same output if you
Change the input you change the output and therefore the next block which stored the old hash for the old input would recognize did something went wrong that is an important security mechanism and that is how the blockchain is built you got all these blocks and the next block always knows about the previous
Block now that’s a lot of theory what’s a cryptocurrency then because a cryptocurrency is the most prominent use case of a blockchain and a cryptocurrency is really just something which uses the blockchain technology if the data you store in a block is a list of transactions and a transaction is
Basically just a piece of information where you say who is sending how much to whom these free things are important if you get a list of such transactions in a given block you obviously can take advantage of the security mechanism that these transactions can’t be edited without the next block recognizing it
And therefore now you have a cryptocurrency you have your own cryptocurrency managed in your blockchain which is distributed across many machines and which is therefore secured and that is what’s used by Bitcoin aetherium ripple and all the cryptocurrencies you know so back to the picture from before our data now simply
Is that list of transactions it’s that simple and what are the coins then well the coins is just something you come up with you can give the things you’re transferring in the transactions whichever name you want coins are transferred with transactions that’s all you have to from and how much the how
Much that is your coins and you can name them whatever you want the coins normally can’t be changed to our real currencies unless you find someone of course who says hey please send me some coins and I will give you this amount of US Dollars or this amount
Of euros this is how it works the worth of the coins is really just what people think it is and this is how it works for all these cryptocurrencies that also explains their high volatility it’s a new market and the true value of these things is still something we have
To evaluate and finally coins are created with mining because of course we can send them around but this doesn’t create them mining is a crucial part and mining is how new blocks are added we will have open transactions where you want to send something to someone and
For that transaction to be confirmed it needs to be included in a new block which is added at the end of the blockchain people who are adding this are doing the so-called mining because this process actually takes a bit longer they have to solve a complex algorithm
And they get some new coins out of the system as a reward so if we want to summarize it in a big picture this is how a blockchain looks like it actually runs on multiple machines so called nodes you also might have heard of the
Term wallet a wallet in the end is just a note that is a simplification we’ll use in that course a wallet in the end is what enables you to send and receive coins it’s a piece of data which allows you to identify yourself you can say and then you can send coins fruit
Transactions to our wallets and if such a new transaction is created it’s broadcast to the nodes nodes also distributed across the whole node network and they will verify a transaction while doing so to make sure you have enough funds and to make sure that you really are who you claim to be
And once a couple of transactions have been collected one node will eventually bundle them up in a new block and then inform the other nodes about that new block so that it is added to the block chains of all the nodes and all the different computers only after this new
Block and the whole chain that belongs to has been verified but all the nodes of course so that’s the blockchain in a nutshell as I said I’ll come back to all these core concepts throughout the course in the end it’s a distributed secure data storage where each block is
A folder with some content some data inside of it and it’s a cryptocurrency if that content is transaction where we send coins from A to B so now that we had a first look at what pipe Ness and what the blockchain is and that we installed Python and wrote our
First program let’s see what the course as a whole has to offer for you we’re almost done getting started in the next module we’ll dive into the core base syntax of Python and regarding our blockchain we’ll start building a simple chain a simple list of coins for now a
Coin will just be an amount just a number but it will be a great start thereafter we’ll dive into loops and conditionals useful constructs that allow us to execute code either multiple times or only under certain conditions regarding our blockchain we’ll be able to then verify our blockchain and check
If the previous block is still the block it was when we added its next block so this connection between blocks we can start verifying it here thereafter we’ll start working with more complex data structures because thus far we’ll only have had a look at numbers text true and
False so called boolean and lists now we’ll get into more complex data structures which will then also allow us to work with real blocks and transactions which is more than just a number we’ll dive deeper into built-in functions so functions pipe and ships width as well as text so called strings
And will be able to then calculate and output the balances of the different users of our blockchain well thereafter have a look at the so called standard library this is this batteries included approach I was referring to the many packages – already has built in we’ll have a look at them
And some selected ones in this module and therefore we’ll be able to start creating real hashes and the so called proof of work an important blockchain concept will then learn more about reading and writing files something we already did in our first pipe nap here at the beginning of this course but here
Of course we’ll dive into it a bit deeper and learn more about what’s happening there and how we use it and how we can do different kinds of reads and writes regarding our block we’ll finally be able to store and read our blockchain in files and not just in memory
We’ll then also have a look at what we can do with things go wrong how we can handle errors how we can debug our code and find problems in our code this will allow us to make our blockchain more robust and more secure more safe will then also have a look at object
Orientated programming with classes this is super important it’s a cool feature of modern programming languages and – has it – even though python is actually a bit older but – has that – it allows us to write cleaner code I’d argue easier to understand code and we’ll use
It on our block can to improve it and also to finally add a wallet this identification data which will in the end be super important for sending and receiving funds once we’re done with that it’s time to dive deeper into modules and packages we’ll see how we can install third-party packages and
Split our code over multiple files regarding a blockchain we’ll be able to sign transactions an important security mechanism and then we’re already nearing the end of this course but we already learned a lot about the basics but we won’t finish the course before all the
Diving a bit into HTTP and how we can handle incoming HTTP requests with Python and the flask package for our blockchain this will mean that we can control our blockchain with a nice web UI and therefore leave that terminal based UI we will have used until then
And thereafter we’ll also have a look at how we can not just receive requests with – but also how we can send them and therefore how we can communicate between different Python programs we’ll also use that in our blockchain to simulate multiple so-called nodes so servers running on different machines which now
Can communicate with each other to broadcast new transactions blocks and all that stuff and there after we’re done but of course I’ll also let you know what possible next steps are where and how you can dive deeper and what you have learned in this course so a lot of cool content in there
All the basics you need to know about Python and I can’t wait to dive fully into it with you just a couple of other things about Python which you should know before we do get started there are many good reasons for learning a language like Python I already
Mentioned a lot it’s versatility ease of use and what you can do with it I guess that’s the worst Atilla t you can build all kinds of things with it but of course there are other languages than Pyfrom – there is C++ for example this awls is an extremely powerful language
And it also can be used to build all kinds of things but it’s a bit more complex than – you write things more from scratch than with Python it has less things built in you have to solve more problems on your own I’d say so
It’s a bit harder and we mostly use it for desktop apps it’s very popular for creating games for example but they’re also often it just runs behind the scenes and you use some framework some engine that builds up on it so you can absolutely write C++ code but it’s a
Complex language and often you have other languages you use instead and for example PI from the version we’re using builds up on C which is not exactly the same as C++ but generally related to it and Python is an extra layer on top of that you could say which is more
Accessible we also have languages like Java Java is also very versatile app which we can use to build desktop apps web apps and even mobile apps with Android and speaking of Android we also have things like Swift or objective-c which you use to build iOS apps or Mac OS apps
We have languages like JavaScript which run in the browser or also can be used on the server so which you’d only use for building web apps PHP would be another example a language you really only use for building websites and web apps and then you will again have Python
Which is very versatile which used for data science desktop apps utility scripts and web apps so which one should you choose why is Python the right choice it obviously depends on what’s you’re building the cool thing about versatile languages like Python is that if you learn it you are basically free
To build whatever you want at any given time in the future there are some languages like Java the script in the browser where do you have no alternative – can’t be used to run in a browser – you build the front end of a website so to say and – all who
Can’t really be used to build mobile apps but Python can be used for a lot of things that happen on a typical computer or when we talk about web development to build a web server and therefore this versatility really is a huge plus in case you’re starting off and you’re not
100% sure where you want to go or if you know you want to go into a direction where Python is really strong like server-side web development or data science it’s all important to recognize that only the two languages here on the right Swift and JavaScript in this example
Here have a UI attached to them by definition these allow you to build things where you see something with a nice UI relatively fast because you’re either building mobile apps or you’re building websites and both lead to things you can see you can touch you can use other languages like Python C++ and
Java are more on the built the logic part less on the presentation part and therefore you can add you eyes to them and we will in this course but the core of Python and so on is really just the logic that runs on your machine which is
All that the reason why for the majority of this course we will work in the terminal and execute our code on our computer because it’s doing a lot of logical work which of course is the driver of any important application the logic that happens in your program not
The presentation but as I said we’ll add the presentation in this course to now to come to an end in this module let’s have a brief look at the Python history and more importantly at the two important versions that exist we get PI from 2.7 and free Dex currently free dot
Six is the latest version soon it will be free dot seven now what’s the difference Q dot seven is an older version it’s the legacy of python learning it right now is not really something I would recommend or anyone would recommend there are some very very very niche
Cases and if you need to cover them learning the more modern version free Dex is still a better choice because it will then make it easy for you to learn in 2007 anyways but generally you don’t need 2.7 free dot X is the future so whichever version of free is currently
The latest one this will be the future of python eventually we’ll probably also have a version 4 but for now we have version 3 and that will stick around for quite a long time version 4 is not even something that is known when it will be released right now
So that is version 2.7 versus version 3 dot X 2 dot 7 was released in 2010 and will be supported in 2020 so in case you need to use it you got two years to go but as I said free dot X is the one which is currently still active under
Development 2.7 is the last 2 dot X version there will be no 2.8 free dot X is still under development still gets new features and improvements it is the future of Python this is why you should learn it 2.7 has a slightly different syntax most is the same but there are
Some differences because free dot X added a lot of improvements and additions to the language made it better brought some things in line which previously behaved a bit differently and strange so it really added a lot to the language there still are some very few libraries that only work with Python 2.7
But the vast majority of all third-party packages you might want to use have been ported to free X so this should very rarely be an argument for picking 2007 and therefore learnfree X it’s all the diversion we’re using in this course for that reason it’s the future of Python and of course
You want to learn that future in this course so we’re pretty much done getting started in the next module we’ll dive into the base syntax of Python but I won’t go there without letting you know how you get the most out of the course because that is really important to me
You get the most out of the course by watching the videos now that seems obvious but there’s more than one way of watching videos make sure to watch them at your speed if I’m going too fast you can use the controls in the udemy player
To slow me down if I’m going too slow you can use them to speed me up also pause regularly if you’re coding along which I strongly recommend you might need to pause a video so you can catch up with me because if I take too long breaks everyone who’s not coding along
Will have a hard time and will get bored so I’m trying to find the right balance and therefore it’s important that you adjust the speed that you take pauses and also that you sometimes rewind the video if there’s a concept which is not clear it’s on the montt course so take
Advantage of this this is really how you get the most out of that so code along that is something I do encourage you to do do the exercises I offer in this course they are great for checking whether you really understood a certain concept the things taught in a certain
Module and of course use the course resources so all the source code I show is attached to this course and not just one code attachment per module but most of the time I have multiple snapshots per module you’ll find them attached to the last lecture of each module and
Download and compare them to your code if there is something which is unclear if you’re facing some strange issue then my code is really there to help you the same goes for links which you find in the last lectures of each module there I provide useful links to other resources
Which allow you to dive deeper learn more or look things up so definitely take advantage of this too now sometimes you just get stuck though or there is something you you don’t fully understand ask in QA I’m happy to help there I do read a reply there regularly so I do my
Best to provide quick help in QA but if you can help our students that’s even better not because you’re helping me but because I really mean it like that this is the way how you learn the most I guarantee you that this is an awesome way of learning
Way more because asking it’s super simple but answering solving a problem that’s difficult and I can only encourage you to do that it can be challenging to go out there and put your opinion out there and solve a problem and potentially be wrong but what could happen you’re wrong
So what then you get corrected and you’ll learn again so definitely give that a try and answer in the Q&A section you’ll find a lot of problems there and solving them that is something where you can learn a lot and at the same time also help other students this is how you
Will get the most out of the course follow these steps and you should have a more than solid knowledge of the Pythian fundamentals and core concepts and how to write Python programs by the end of the course and a nice side effect you’ll also have a very solid understanding of
What the blockchain actually is and how it works so with that let’s finally dive into the next module and start with the base syntax of Python so let’s start diving deeper into – now that we played around with it a bit in the command line and did we learn the
Basics about what a blockchain actually is it’s time to learn the base syntax of Python its core features and of course also to start building our basic blockchain in this module we’ll therefore have a look at the rabble so this command line again and we’ll also explore how we write a real Python
Program outside of this command line with normal files and an IDE and integrated developer environment now that’s of course just the setup part thereafter we’ll dive into the Python language and we’ll start working with variables and see which data types we can store in these variables and of
Course what variables are to begin with now we’ll also see that with variables alone we can’t do that much so we’ll also have a look at operators will understand what operators are and which operators exist and how we can use them now we will build a block chain in this
Course and as the name suggests a block chain includes that chain part so multiple pieces of something therefore in this module we’ll also explore what lists are in how we work with lists in Python and you round up this module and write a program that is a little bit
More useful than what we had thus far we’ll also dive into functions a very useful language construct which we’ll use quite a lot throughout the course now that’s the Python part you could say what about the Plock chain well regarding the block chain at the end of
The module we’ll be able to manage a list of blocks and each block will actually contain some data or a list of data so we will start working with our coins in the section even though our block chain won’t be finished by the end
Of it of course we’ll be able to add or mine data to our block chain and we’ll also be able to output our block chain so that we can see it so with that let’s get started and let’s dive right into it before we start setting up a local
Environment let’s go back to that command line approach I called it the rebel now rebel stands for read eval print loop the read part is basically the part where we enter something into the command line like two plus two evaluate or evil is the next phase where
Python analyzes our command once we hit enter now once it’s done analyzing it prints the result for in this case and the L part the loop is basically where it well goes back to start and waits for the next input that is why we refer to that command line interface to the rebel
It is an interactive shell where we can just issue commands and let – do the job it’s not really helpful for writing big Python programs but it’s a nice interactive way of working with Python and great for simple calculations and practicing so let’s go back to the wrapper
Before we actually set up a real project with an IDE of course we’ll go back to the rabble to start working on our block chain and for that let’s leave out the node and transaction part and let’s focus on the chain of blocks which contain data now that of course means we
Have Q essential parts we got the data and we got the chain now for data in this module we’ll have a look at which types of data we can use in Python because no matter which Python program you’re going to write if it’s a flight booking system if it’s your own search
Engine or if it’s a block chain you will work with data all the time data your user enters data you read from some file anything like that and for data we can basically work with numbers strings which is text or boolean and we’ll have a closer look at what this is
And what all these data types are in just a second we also have more complex data structure said which we’ll have a look at later in this course now the chain in the end is just a list a special type of data in Python as you
Will learn now let’s go back to the basic data types boring and boolean numbers are divided up in integers which is basically a number without a decimal place and floats which is a number with a decimal place and we have both negative and positive values for numbers we obviously
Work with numbers a lot in most programs be that your accounting software you’re creating where users might enter their data which typically would be numbers or be that your plug chain where a user sent money around most programs work with some kind of numbers we also get
Boolean stowe and boolean are two kinds of values true and false now this might not look super useful if you’re brand new to programming but actually being able to tell if something is true or false is very useful if you’re working with conditions something we’ll also
Dive in in the course sometimes you want to check if something is true if a certain condition is met and then execute a certain part of your code and execute a different part of your code if something is false and therefore boolean are a great way of handling that but of
Course again we’ll see how we use them in practice throughout this course and strings are just texts well just like numbers working with text is obviously something you do in pretty much any program again be it as your accounting software where you enter the name of a
Certain transaction which is going on or be that your blockchain where you enter the sender and receiver of a transaction which might have a unique name or something like that now strings in Python can be written with single or double quotation marks and you should simply pick either of the two approaches
Whichever you prefer and then stick to it they are exactly the same now finally I already mention it we got complex data types like dictionaries and objects will not worry about them right now we’ll come back to that later in the course now with that let’s see what
Exactly numbers are and how we can use them in a typical Python program now to work with numbers I’m back in the rabble or right now it would be precise only in the terminal or command prompt of my machine we entered the Python rebel by typing Python assuming that
Python was installed which we did in the first course module now once you hit enter you’re in the Python R Apple and you can always quit it by hitting ctrl set now let’s get back into it though a number is simply something like this – if I enter it just basically prints out
What I entered now often you work with data so not just with numbers but also with strings and boolean by storing them in so-called variables variables are data containers you could say which you define so you could create a variable by simply typing a name for it which could
Be age the name is totally up to you and then the variable only becomes useful if you store a value in it so you can think of a variable as an address like the number of your house you then store something in there by adding an equal
Sign and on the right side of the equal sign you write what you want to store in that address so in that variable for example 29 which would be my age if you had entered here in the rebel it will not output anything but if you now just
Type H it will print out the value you stored in age now this already is a very useful and important part you gotta understand we will work with variables a lot in this course any program uses a lot of variables because as the name suggests they allow you to do dynamic
Calculations you cannot just hard-coded value in there you can also manipulate that value whilst your program runs for example here if I type age again and again prints 29 cost test value which we stored and it keeps that in memory it does not clear it after we output it one
Time and if we now for example set H equal to 30 and a type age again it changed it it overrode this we could also write H equals age minus 1 so now we would take the Privy value which restored in age deduct one from it and store that new value which
Is calculated on the right side of the equal sign back into the H variable if I hit enter and type H again it now outputs 29 for that reason and this is the usefulness of variables we can do a lot with them we can run all types of calculation store in between results
Which we might need at a later point of time in our program and of course also output them to the users and thus far in this case here we only work with numbers with integers to be precise with numbers that don’t have a decimal place of
Course you can also store floats in a variable like here now it’s not 29.5 and if I output this we see 29.5 and obviously you’re not limited to numbers you can also create a variable which isn’t is old the naming convention here by the way in Python is to name it like
This if you got one variable that consists of multiple words you cannot write is old with a blank that’s invalid it has to be one word but you still make it easier to read you use underscores to separate words so you got all lowercase names with underscores between the
Different words this ensures readability and this valid Python syntax but back to what I originally wanted to say you can store for example true in here that’s a boolean do you remember that slide true and false now you got is old in here and with that you can of course
Also output that and later once we learn about conditional checks you can use that cue check if is old is true because let’s say that is calculated dynamically and then run a different code if that is the case instead of running the normal code which you might run if is old is
False the last but not least let’s also have a look at strings if I enter name the important part here is the quotation marks so single or double quotation marks both works and then the text in this case max make sure to also closed equitation marks now if you output this
You got the name printed here so these the free core values or datatypes with which we work in Python numbers where we have integers and floats boolean swear we have true and false and strings which are just text enclosed by double or single quotation marks
Now that we had a first look at the important data types and how we use them with the very important concept of variables let’s have a brief look at what exactly can be done with numbers or some important information you should have on them so we got integers and
Floats that’s no news to you here are examples for integers and the important part here is an integer in Python can be as big or small if it’s a negative number as supported by your memory and operating system because 64-bit systems for example can leverage more of the
Memory than 32-bit systems that’s why the operating system also matters but the important part is this is the only limiting factor there is no built-in cap or limit so if you want to store a really big number in the variable you can probably do that if your memory
Supports it now another important piece of information sometimes you have some data in a different data type let’s say you have a valid number which for some reason is stored in a string so text let’s say you have the text 10 you recognize that it’s text because of
These rounding quotation marks but you’d like to do a calculation with it now let me show you how this would work here’s an example let’s say I have my age which is 29 but notice the surrounding quotation marks if I now output H +1 here you see I get an error that this
Must be a string not an integer because H is a string but 1 is an integer so what would work is H plus 1 and now we would have 291 because it’s now not doing the arithmetic addition where it adds 1 to 29 it’s just concatenating the
Two strings and creating one word out of the tube now this is of course fine if you had something like hello plus world and you wanted to create one combined string but it’s not what you want if you’re working with numbers and to fix this or to have a solution for this case
2 there is a helpful function int if you wrap a string or a float with that function it actually converts it to an integer which you can of course then use as a normal integer because it is a normal integer so back to the example
Here we could say int age and this would convert the age string which is 29 Q an integer plus 1 and now we don’t get an error anymore so this error from above is gone but now we get Ferdie as a result no as a side note if you wrap
Something which can’t be converted you get an error if you wrap a float you get the well rounded integer to be precise as you can see with 1.8 it always rounds down so it basically creates the floor of it it cuts off the decimal place and
If you wrap true for example it gives you 1 and in false would be 0 that’s also an interesting convention to keep in mind true converted to an integer is 1 false is 0 and of course we can also do these conversions with negative numbers as you can see there it all just
Cuts the decimal place so this is the int function for floats we also got some examples here it’s all important to know that your memory and operating system is the limiting factor when it comes to the size or the biggest number or the smallest number you can store and just
As with int you got the float function to convert our types to float here’s another example let’s say H is 29 as a string again now we can also output float H and we get 29.0 because it’s converted to a float so to a number and as a special number a float therefore
Float H plus 1 would give us free dot 0 if we said float true or if we write this we get 1.0 and float false is what would you guess it’s 0 dot 0 so it’s basically the same result as with the in function but always attaching a decimal
Place so just a Stian function this is very you if you got some data in the wrong data type but with a value which you know that it can be treated as a number and then you got an easy way of converting that data type to a number now one final
Piece of important information I want to share with you both integers and floats can also be written like this year at the bottom you can add underscores to make long numbers easier to read so let’s say if I would store the amount of fans I got where it certainly is 1
Million then I can of course do it like this there’s a bit harder to read though so what I can do is I can also write it like this the output fans I still get the outer format because that’s the number with which Python will calculate but when
Assigning the value this clearly is easier to read if I output fans +1 I still get the more unreadable output though because again internally there only is one type of number this underscores syntax is only there for improved readability we had a closer look at numbers now
Before we have a closer look at boolean x’ and strings let’s have a look at something where we already used one part operators now we already use the plus operator to add two numbers I guess it’s pretty clear what the plus operator does it’s called operator because we perform
An operation with it we add two numbers in this case now of course Python has more than the addition operator we can also do subtractions for example we can simply take two numbers and subtract them from with Java now of course we’re not limited to that we can do all the
Basic arithmetic so we can also multiply numbers we can also divide numbers like this and here the important part just is here note that we’re dividing two integers 5 & 10 but the result by default actually is a float so Python does not give us an integer something
Like 0 maybe because it cuts off the decimal place but it does the conversion to a float for us and gives us that float result now if you want to have the other behavior though if you want to get an integer as a result you can use the
Double slashes that is the floor division operator here for the same operation with the double slash operator we get 0 as a result because it automatically cuts off the decimal place we also get two asterisks which would be the power operator so if we got 5 to the
Power of 10 for example we would get dead result here so this is really just allowing us to do some exponential calculations now last but not least whenever a core operator we gotta know is the modulus operator we can use it to get the remainder of division so in this
Case here 5 divided by 10 we can’t divide this 10 doesn’t fit into 5 one single time so the remainder is 5 and that would be the result now one important note about these operators plus operator all that works with strings as you already saw you can concatenate two strings
And to multiply the multiplication operator also kind of works with strings but only if used correctly let me show you what this means if we got a string like hello and another string like world if we add the plus so the addition operator – will concatenate both into
One string so if we create a greeting variable and we store that hello world text I just created and we are for treating there after then we just get hello world here so one string now that’s good to know I also mentioned that you can multiply strings now what I
Don’t mean is that you can do hello times world if you try that you’ll get an error because this is a type of multiplication Python is not capable of doing what you can do however is you can take a character or also some text like hello and multiply it with a number like
10 and then Python will repeat that text 10 times and concatenate it into one string this is often useful if you create some kind of graphical output with let’s say some separation you want to create a horizontal line well you can do it like that
This is what you can do with strings the other operators which you use just with numbers and that includes both integers and floats should be pretty clear and simply play around with them to learn more about them with these very basics about numbers and operators out of the way you’re probably
Wondering how we’ll use that in the blockchain well we’ll use that data to store it as data in our blockchain so as the amount of coins we’re sending with a transaction for example but before we do that there are two important things I want you to understand about numbers
Because you might encounter it and then it might look strange one is you can also write longer numbers in an exponential notation like 1e 10 that is a valid number which pipe will read and store as this number so this year would be 1 million for example and
As you can see it automatically stores it as a float and the even more important part is if you do something subtraction like 1 minus dot 9 what would you expect as a result well you clearly would expect 0.1 right but if you had entered you actually get a value
Close to 0.1 now this clearly is not the value we expected we expected 0.1 as a result now the reason for this strange-looking result is dead as you might know computers work where zeros and ones they work in the binary system therefore any floating-point number is a
Challenge for them and that’s not just a case for Python but for any programming language the reason for this being a challenge is that anything which is a decimal place no matter if it’s 100 dot 1 or 0.1 is lower than 1 so the part
After the dot always is lower than 1 per definition now values lower than 1 are difficult because they only know 0 and 1 so values lower than 1 have to be reflected as a fraction of 1 and when doing these fractions they run into problems if you’re working with values
Which are hard to devise by 2 so if it’s not a binary fraction and 0.9 isn’t then you’ll have a problem for there reason one Minister five actually leads to a clean result because dot v can be written by the computer or understood by the computer as 1/2 now 0.9 cannot be
Written like this because there is no integer by which we can divide 1 which will lead to dot 9 hence it will actually chain a couple of divisions and that would really be too complex here which leads to the computer getting closer to 0.9 but it never fully reaches
It and therefore 1 minus 0.9 actually leads to this strange output and therefore even if you type 1 minus dot nine minus dot 1 you get a value very close to 0 but not exactly zero so this is a limitation or a certain missing precision you have to be aware of it’s
Not really an issue in your day-to-day life because these approximations actually give you a very close approximation but it is something to be aware of and most of all I don’t want you to wonder if somewhere in the course you see a value like this it’s coming from that missing floating point
Precision which is inherent to computers and also therefore to Python it’s not an issue of pipe though it’s something the computer basically well has its issues with now let’s also have a brief look at how we work with strings strings are generally really easy to use as you
Learn you create a string and store it in a variable for example by using quotation marks either double single quotation marks with your text in between or double double quotation marks with the text in between either of the two can be used you can’t combine them
Though so you can’t open with a double quotation mark and close with a single one or the other way around so you have to stay consistent the advantage of double quotation marks is that there you could also use the single quotation mark as part of the text like in I’m pretty cool
Where is for single quotation marks this will fail I am pretty cool there still is a way around this with single quotation marks Q you can escape that character and I’ll again dive into escaping later in this course but you can add a backslash in front of the
Character you want to escape and now it is accepted and if you output the string you see now you just got the single quotation mark and double quotation marks around it but there are your options double or single quotation marks now if you’ve got a longer text you also
Sometimes want to have multi-line text and you can create multi-line strings by using three double quotation marks opening and closing and in between you can add your text which can also span multiple lines as you can see here if I don’t close it but just open it you can
Add your text then you can’t continue typing on the next line which can span multiple lines and close it with three double quotation marks once you’re done and then you’re a longer text is actually in line if you output it with another special character in between for
The line breaks backslash n marks a line break but this makes entering it much more convenient since you can really type it across multiple lines too now we’ll come back to working with strings and escape characters like this later in the course for now it’s important to
Know that you can have single or double quotation marks or for multi-line text also triple double quotation marks enough about the basic datatypes we want to build a blockchain we’ve had a first look at the data we’re going to store in that blockchain so in the blocks of our
Blockchain and later in the course we’ll of course refine that data to reflect a full transaction and not just one word or one number but for the blockchain we also need to chain part and for that we’ll use a list a list in Python is created with square brackets you might
Know it as an array in other programming languages a list holds different values they can be of the same type so it can be a list of numbers or text but it can also be a mixed list like this one this list has text a floating number boolean
And even a nested list which in turn holds some text and a number important the elements in the list are separated with commas and a list in Python has a certain length which we can get from it in this case but before it this gives us the information about how many values
Are inside of a list now typically we don’t just want to have a list to look at it we also want to be able to access the elements in our list and change them or output them and for that we’ll need something which is called the index each
Element in the list has its own index and here’s something very important which is something you have to memorize the index and pipe lists starts with 0 so we get 0 1 2 3 we’ve got 4 values but the first value has an index of 0 therefore the last value in this case
Has an index of 3 and accessing values by their index is actually super simple we take the variable name in which we store the list let’s say it’s my list and then we use square brackets and the index to output or to access the value stored at this index in this case it
Would be some text let’s have a look at this in practice let’s say we’re creating our block chain and therefore all create my block chain variable and this holds a list as I said we created with square brackets where we now add values now we obviously are
Building our coin in this course here so let’s say our values are the amounts of coins we’re sending with transactions right now we unfortunately have no way of storing the sender and receiver of the coins we’ll do that later in the course of course once we had a look at
More complex data structures but the amounts is something we can already store so let’s say in the first transaction we send one coin in the second transaction it’s 8.6 coins in the third transaction it was 5.1 coin of course no one’s stopping us from also adding some text
Here so this is really something you as a developer set up so this is our blockchain obviously with hard-coded values no chance for the user to input his own value if I hit enter and I then output blockchain like this here is our list now let’s say I want to have a look
At that second transaction only then I can access it with blockchain and then here what one because remember the index starts with zero so the first element 1 in this case has an index of 0 if we want to access the second element 8.6
It’s in X 1 and correctly we get 8.6 as an output here now we can also use these values in operations let’s say we’re some kind of hacker and we’re changing the amount of coins sent in these second transaction so we could say blockchain
Plus 2 if we enter this we get 10.6 but interesting enough if I then output the blockchain list again you see here the value is unchanged now why is that the reason for this is that with blockchain 1 we’re basically copying the value out of the list we’re not setting up some live
Connection to the element so if I add 2 here I’m adding this to the copied element and hence if I do add this here we correct to get 10.6 because we copy 8.6 out of the list and then we add too but the original list as you can see is unchanged
Now that copying part is actually something which will become important later again once we also work with more complex data structures because there I will show you how you actually have to differentiate between different data types whereas some are copied automatically whilst others are not but for now with strings numbers and boolean
It works exactly as I explained it here typically you’re not looking to hard-code your array and then leave it like this you got certain circumstances where you want to do something to your list at certain points of time in your code let’s say we want to add an element
Now our list is set up up there and of course we could add an element by simply redefining the entire list like this and now we add ten as a new element and if I output blockchain we correctly see the new list this is very cumbersome though manually recreating lists all the time
Not really something we want to do thankfully there is a special function or method we can use now I’ll dive deeper into what functions and methods are in just a second but for now let’s simply call it by adding dot append after our list that’s a built-in method shipping with
Python and add parentheses here now if you add free here and you then output the blockchain again you see that free was ended at the end so whatever this method or function is again we’ll have a look at this in just a second it seems
To take that value we pass to it between the parentheses and in the case of the append method added to our list now we also have a different method which we can call and there are more methods than just these two by the way pop and this will actually return a
Value instantly free which was the last value on our list and if I now output the list you see the last value is missing so pop is actually removing the last element of the list outputs it or it gives us a chance to store it in a
Variable if we would use blockchain pop on the right side of an equal sign where we store it in a variable and then it manipulates the original list and removes the element from there so that’s a first glimpse at functions something we’ll dive on in in the next lectures
And this is how we can in general work with the list and how we can start building our blockchain and actually whilst this blockchain is very simple is how we will work with it throughout the course we’ll manage our blockchain in a list and later the things we’ll
Change is of course how we work with it how we manipulate it how we verify it and check if it’s valid the type of data we store it’ll be more complex and of course we’ll also learn how we store it in a file so that it’s not lost if we
Restart program because right now if I quit here and I go back into my rappelled mode the blockchain is gone this variable does not exist anymore because it basically resets the old state whenever we restart this so that’s all something we’ll fix throughout the course once we can store that in files
So we got the very basics about Python out of the way to learn about the core data types and how we store them in variables however thus far we did everything in the rattle now we’ll switch to a real development environment and to a local IDE and we’ll
Continue building our blockchain in the end we won’t ever chain which will be a list which holds our blocks of data and here’s something new I want each block to be a list on its own on itself and in that list of data basically so inside of
The block will then store our values and for the first block it might be one value but the important part is for the other blocks in the blockchain each nested list will actually always contain the previous values to kind of simulate that part which I mentioned early and
The course where each block knows about its previous block by its hash now we won’t hatch it here because that requires some knowledge we don’t have yet but we’ll kind of fake it by ensuring that every block is just a nested list which contains the previous
Values as well as the new value so it’s basically like that game where you’re packing your bags for leaving and you name one word like toothbrush and your partner then has to name your word toothbrush as well as a new word towel and then you say a toothbrush towel and
Let’s say a comp and that is basically what we’ll do here each block contains the old data plus a new one and this is something we can totally build with the knowledge we already have and of course we don’t want to use random data we’re going to build our own coin so let’s
Start by storing transaction values and obviously we’ll refine the values throughout the course now as I said we won’t do this in the rappelled l will use a local IDE and a more elaborate setup which you typically use for any bigger project you build to work locally we’ll work with text
False and we want to write code in these text files which is easy for us to write and to understand and for this we’ll use an IDE an integrated development environment which is a tool basically a text editor with a lot of additional features which make writing code more
Fun and easier because we’ll get suggestions errors will be shown to us automatically we get different colors for keywords and so on it’s more fun to write code with an IDE theoretically you can’t use a normal text editor like the one shipping with your operating system though for this
Course I’ll use Visual Studio code it’s a free IDE and you can download it from code dot visual studio comm make sure to choose your version for your operating system and simply download and install it there should be nothing complicated about that now they’re all just an
Alternative which I want to bring to your attention it’s called pycharm and you can simply google for it and click on that link you should find there and whilst there is a paid version of pycharm there also is a free version of it you simply have to
Scroll down a bit and then pick that pycharm Community Edition can download that for free and use it for free and this is a different idea all the bringing the advantages like color coding and so on which you can also try out however I’ll go with Visual Studio code once you installed Visual
Studio code you can open a folder which you should simply create in your Mac finder or Windows Explorer where he will store your project so that’s blockchain project simply create a new folder somewhere on your machine for that an empty folder then you pick open folder and simply navigate to that folder here
I selected my Python blockchain folder and I’ll click open and now it is opens the folder in the IDE I’ll let me hide this here and now if your installation looks a bit differently I simply entered presentation mode here and remove the toolbar at the bottom for example and
What I also did is I switch the theme to dark you can do that from the menu by clicking on preferences color theme there you have two choice of different built-in themes and I simply choose dark plus this default dark theme this is my setup here now to work with Python we
Also want to install some extensions that make that a bit easier for this you can simply go to view and then extensions or if you didn’t remove that sidebar you’ll also have an extension buttons here on the left but view extensions will always work and
In there you can search for Python now I already installed it but this first pipe package here is the one I recommend installing as I said I have it installed but you’ll have an install button here simply click it and restart the IDE when prompted to do so now additionally in
This course and this is totally optional all you see material I can theme here which simply changes the file icons which will be displayed in this project you can all install that but again this is purely optional the PI flex tension is one you should install though
Thereafter you can go back to view Explorer now in here you can create a new file by clicking this new file button or a new folder with that button or with command N and here I’ll add my blockchain file the important part is since we’re working with Python it has
To end with dot P why this turns it into a Python file now let me quickly switch to my uber icon theme yeah I prefer that so this is my blockchain Python file and this is the file with which I’ll work for the next lectures now obviously you
Might be wondering how do we execute that file now and the answer is from within your terminal in Visual Studio code you can also go to view integrate a terminal or use the shortcut which is displayed there and this will open your normal operating system command prompt or terminal automatically navigate it in
To your project folder and there you can run Python and then a blank and then the name of the file like blockchain dot PI people in this case and it’ll execute that file and in this case it does nothing because there’s nothing in the file but if I
Were to for example use print function which output something to the console if you’re not using the repple you’ll have to explicitly tell python to output something so if you use print and you output 2+2 for example and you save the file don’t forget that if you run the
Command again you see 4 down here so this is how we work with files and how we work with visual studio code as our IDE and with that let’s continue and I mentioned print is a function right and we saw that append and pop function Q so let’s dive into functions next because
This will allow us to create a better block chain what are functions if we use built-in functions we get some utility out of the box some magic happens behind the scenes which we don’t know but which does good things for us typically but of course we can also define functions for our
Ourselves and function simply allow us to define code which is executed later and possibly multiple times and we of course define when it’s executed a function in Python is defined like this we use the DEF keyword then the name of the function then parentheses and then a
Colon if you’re coming from a different programming language like JavaScript you would have the function keyword and curly braces now Pi uses Def instead of function and colon instead of curly braces and now that’s very important to understand it then uses indentation so some white space to the left you should
Use four spaces here too from white or write the code that will be executed whenever you call the function now calling a function of something which is done like that or like that this is the multiple times execution I’m referring to when you define a function so the
First part nests box nothing will happen Python will recognize that but not run the code in there as soon as you call it though by using that function name with parentheses it will execute the function and run the code that’s in there now regarding the syntax also note that in
Python not only in functions but actually entirely in Python you don’t use semicolons at the end of the line and again you don’t use curly braces you use indentation and you should use for spaces instead of tabs here however the good thing is in ideas like visuals to
You keep code you can’t actually hit the tab button and it will enter four spaces for you so you get that convenience back to the functions though this is a simple function here it simply outputs something now let’s actually use that in conjunction with our block chain let’s start building our
Blockchain with the help of functions in our blockchain dot py code here I will first of all recreate my blockchain variable and also as a side note unlike in other languages you don’t have a var or something like that in front of that you just type the name of the variable
And this should be a list and actually it’s an empty list at the beginning now we obviously wanna add values to that list and for that we can use a function so we define a function here and I’ll name it ad underscore value this again is that naming convention which also
Applies to functions where you write an entirely lowercase and you separate words with an underscore now important when the finding a function you have to add a pair of parenthesis and then a colon and the nice thing is you can already see the color coding here in
Visual Studio code so Dada support for the keyword which is marked blue and your own name which is yellow if you hit enter now you see it automatically indents this line so it helps you with that that’s part of the reason why we use an IDE now here we
Write the logic we want to execute when we call this function and this can be more than one line by the way now here I want to add a value to the blockchain here we see an a variety II feature we get suggestions on which methods we can
Call on a list so it detects that blockchain holds a list and helps us with working with it now what to call a pen here now we also get some information about what we can do with a pen and I want to append a value now
Let’s say we append 5.3 I will now also add a second line still in that function I would be outside of the function if I remove the indentation but if I keep it I’m inside of the function body and here I will use a built in function shipping
With Python which is print print is a function which allows us to output something to the console and here I simply want to output the latest version of my blockchain now we can go down and I simply enter an empty line to make the code more readable
And I removed the indentation by using shift and tap and I can now simply call add value by using the function name as well as the parentheses like this if I save that file and I go into my terminal I can now execute my blockchain dot py
File with the Python command and as you see it outputs my list here now if I execute it again I still only got dead list so it’s not storing that list between executions because basically our program runs and then it’s done and it loses its state thereafter if you want
It to persist it you’d have to store it in a file something we’ll also do later but of course we can go back and we can replicate or call add value multiple times and if we do so and we execute this again you see our chain grows now right now
We’re just storing float values there though if you remember that slide from earlier I said that I want to store nested lists in there which have the old transactions as well as the new one for this back in our function I’ll actually append a new list here and that list
Holds the new value but I also want to hold the last value so the last value of my blockchain here to do this all reference blockchain as a first value however blockchain should not be entered entirely just the last value we have in there so we need to access a certain
Index now index zero would always be the first value if we do that and we save that file and I execute Python blockchain we actually get an error because we try to access a value which doesn’t exist at the beginning right we try to enter blockchain 0 when it is
Empty at the beginning if we start with a value of 1 let’s say and I reacts acute this now it works and you see we’re growing and we always have that value in there but of course we always refer to the first value now there is a convenient trick about indexing which
Helps us get that last value so we start working with functions and we start storing data in our blockchain by appending a new value and also referring to the old value now right now we’re always referring to the first value though which always is a 1 because
That is what we start with if we want to get the last value of the blockchain list we actually can use minus window that’s a convenient trick they’ll trick sounds like it’s some workaround it’s actually a built-in functionality which simply X’s us to blockchain from the
Right so 0 is the first element from the left but minus 1 is the last element because we start accessing it from the right and why not – 0 because there exists no such thing as a negative 0 so minus 1 we could also use minus 2 to use
The second last element but minus 1 will actually now give us the last one if we save that and I run that code again you see now what we have is we got our blockchain here in the last line where we have 1 and the new array with 1 & 5
Free and then we’re nesting this fervour and fervor as you can see because we’re always referring to the last element of our blockchain and the last element will always be a nested list now actually for that reason we should also wrap that starting one with another pair of square
Brackets so that this is a nested list too now with that if I clear this to make it easier to read here we see how we now execute our code we always add an additional level of nesting because if we access the last element in the second
Add value call we get this result because here the last element actually is this list so when we append a new value to our blockchain we take the old blockchain which is this part and then we append the old last value so this one we appended as the first element in that
New array we’re adding remember we’re adding an array here square brackets this is what we append and then this new array where this new list actually also has this value here at the end and for the last add value call this is the part we’re starting
With and then we’re appending a new list hence the outer squared brackets here and in that new list we have 5.3 as a new value this.value but then we access the last value of the old blockchain which is this value here and this is why you now see this value with free opening
And one closing square bracket in here so this is the same value as this up here and that simply is added because it’s last value of the old blockchain so this is the logic we have right now each new block we add contains the old data
As well as the new data the problem we of course is the new data always is the same it never differs it’s always 5.3 so it would be nice if we could actually manipulate that and tell the function here to use different values we learned how functions can work in
General one nice feature of functions is they can do much more than what we previously did they can receive arguments this means that in our function we can expect arguments parameters between the opening and closing parentheses next to the function name and we can use these arguments
Inside of the function like that if we then call the function we have to pass a value for that parameter and this is then dynamically injected into the function so this would actually print hello max here now let’s apply this to our block chain in add value we can add
An argument and you can name that argument whatever you want like Val or value or transaction amount something like this and you can use that value inside of your function body not outside of it it’s only known inside of it so we can use that like a variable name here
And add it here instead of 5.3 and we could have Corozal use that in calculations or in any operations we perform on it so this is my transaction amount here and now if I save that and I clear that just to make it easier to
Read if I execute the file we get an error we get an error that add value is missing one required positional argument transaction amount and we also see in the IDE we got these red squiggly lines the reason for this is obviously add value requires this data to work
Correctly so we have to pass it can pass to dot nine ten point eight nine for example and now if we save that file again and we execute it again now this works and now you see that our values are indeed inserted 20.9 10.8 nine this
Is now taking advantage of the fact that you can pass arguments to functions and if you have a look at this append function the strange thing stillest that we call it on a list well that is something to do with objects and methods we’ll have a look at this later
In the course but in that score is a function and there you can see we also pass an argument right we pass the argument we want to append so append actually alters a function that takes some input we already learned some nice things about functions but they can do even
More than what we learned this far they can also return values and what does this mean here’s an example we got our sum function here and as you can see this function takes two arguments but any function no matter if it takes any arguments or how many it takes can also
Return a value with the return keyword if you use that inside of a function whatever comes after it is returned which means that whoever called that function will get that return value as a result in this case here we call sum inside of the print function which will
Output the value returned by sum we could of course alternatively also simply store the result of some in a variable by using the variable name and then an equal sign and then the sum function call now let’s also apply this to our block chain right now we get one
Function which does two things actually it gives us the last value in our block chain and then it appends this value as well as our new transaction amount Q the unique block chain let’s actually split it into functions so all define a new function with the DEF keyword and lamé
It get last blockchain value now that’s obviously a pretty long name you can shorten it but one idea behind Python really is that you write code that is readable readable code is really a core value of the Python community so using function names like this is actually perfectly fine this function will not
Take any arguments still requires a colon of course and what we’ll do in here is we’ll return blockchain minus one so this will do the extraction for us what this simply means is that in this function here we can call get last block chain value now arguably that got
Longer but from a code reusability perspective here we got cleaner because now each function has only one chopped extract and a pent well actually this function still all the prints it but besides that it only has this one job and we can remove that print statement of course
And simply print the blockchain at the end once we’re done so with this we got two functions now and now it’s all the convention that we should have q empty lines between our function definitions this is something from the official code style guide I will tell you more about
That guide at the end of this module in visuals to your code you all’s got a nice tool if you go to code preferences keyboard shortcuts and there you search for format you will find that format document shortcut find it to anything you want and with that shortcut you can
Automatically format your code in a way that it follows the official style guides so that’s a very convenient so now we got two functions here if I now clear the console and execute my script again you see we get an error here but the reason for this simply is that I
Accidentally deleted the opening square bracket I need to keep this because that last value I’m extracting should still go into a new list so if I save this and we now execute this again now we only get one output because I only got one print statement now but here you see
It’s still extracting the old list and inserting this here and then also this one into here so this is still working but now split up over two functions with the help of the return keyword returning values is pretty neat now let’s go back to arguments though you learned how you can use function
Arguments when additional nice feature is the fact that you can also use default arguments this means you can set up a default argument which will be used if you call that function without passing the data for that argument remember previously we got an error in this case with default arguments this is
Actually something we can do without errors here’s how it works we get a function definition with the greet function this case again and now the H part here actually is a default argument we provide a default value for it 29 then we use it in our function and
The interesting part of course is when we call the function you see I actually don’t pass a second argument without a default argument we would have to do that otherwise we’ll get an error but in this case it works fine without it let’s also use that in our blockchain
Example we have a good use case for that with our starting value here let’s go back to initializing the blockchain as an empty array now clearly if I now clear that and execute my code we get an error because with get last locked-in value we try to extract the value which
Doesn’t exist now let’s fix this by using a default argument here an add value I’ll use my or my add my last transaction value and this is now actually what I will append as a first value in the new block last transaction now what I can do is I can of course
Pass that as an argument to my add value call now I do that by for example passing get last blockchain value get last locked-in value and don’t forget the opening and closing parentheses now if I do that what we provide for the first add value well I can provide my
Starting array here so what we previously added directly to our blockchain definition up here with this code if I run it it’ll work fine and it’ll give me the exact same result as before but we’re not using default arguments here and actually we can improve our code by
Doing so the default obviously is that we want to get the last blockchain value so it would be nice if we could still use add value like this but obviously if this gives us an error as my IDE shows so what we can do is we can go into our
Add value definition and add our default argument by adding an equal sign after the argument name and then the default value in this case this function call to get last blockchain value if when I always save this and I execute the file again this unfortunately doesn’t work
The reason for this is it still executes that even if we do provide a value and therefore it still executes that for the first add value call where we have no last value so we’ll have to fall back to the second pass solution will provide
Our one here so this one array as a default value so that we can omit it here for the first add value call and unfortunately we’ll have to use the longer wish for the subsequent add value calls but still we now got a different way of making sure that we don’t run
Into this below error and we’re taking advantage of default arguments something will of course also see a lot throughout the course so now with that if I clear this and now I execute that file it works again the second best solution as I mentioned but also just one of the
Many examples you’ll see throughout the course now we’re almost done with functions but here’s one last nice feature you should be aware of and Dad our keyword arguments no what’s that again it’s actually not that difficult we got a function with two arguments name and age here’s what happens in the
Function we just output it and now with keyword arguments we can actually alter call a function like this in our function call we use the name of the argument name and H and an equal sign and then the value we want to pass normally if you don’t refer to the names
In the function call the position defines which argument receives which value the first data you pass goes into the first argument the second day that goes into the second argument of course with keyword arguments you can switch to position or also omit some argument after which another argument comes which
You don’t want to omit for example now let’s also add this to our course and let’s take advantage of positional arguments by simply reversing the order for this second add value call so Onam use get last blockchain value as a first argument now of course I can switch it
Like this I’m not using my names here and if I execute this on the first sight it looks like it worked but of course it didn’t work we’re actually now adding our values incorrectly for that second add value call which is the reason why here we have 0.9 as a first value and
The old blockchain as a second value instead of the other way around which we normally want if for some reason we wanted to call it like this however we can do this with the named arguments or with keyword arguments how it’s officially called we can say or we can
Pass that information to the function which data should go into which argument so I could say hey this should actually be the last transaction by using last transaction equal and then the value that should be put into it and this on the other end here is the transaction amount although with
A equal sign and now with this if we repeat that it still works but you can already see there’s a difference this now is the correct blockchain again and not the wrong one so here we’re now taking advantage of keyword arguments and this is everything you need to know
About functions right now how you define them in general that you can pass arguments that you can return data that you can provide default arguments and that you can use keyword arguments which simply means you use the argument name when calling the function and you got greater control over which argument
Receives which data therefore so we’re working on our blockchain it’s slowly taking shape but wouldn’t it be nice if the user could actually enter the values we want to append so let’s add a functionality for that we can’t get the user input with the help of a special built-in function the input
Function this now allows us to provide a string remember that’s a different data type some text which is presented to the user and then the user enters something in hits enter and whatever the user entered is put back into our code so to say so we could say your transaction
Amount please like that and we could store that in T X amount DX for transaction now we could then use T X amount here as the value we store please note that I don’t replace it for the outer function calls for now if I now save this and I execute this file you
Actually see down there the execution stops it’s not printing the final blockchain instead it’s executing this code where we’re prompted for the transaction amount now I can enter 5.99 if I hit enter the execution continues but you now see that this was entered as text though because and that’s something
You have to memorize whatever you pass into your code with input is treated as text and we learned how we can convert it to a number do you remember you can wrap it with int to convert it to an integer but obviously we want to support floating-point numbers so we can wrap it
With float and now we’re able to handle user input with just text as a float so if we repeat this and I now enter 5.99 again now you see there are no quotation marks anymore now it’s really stored as a number now obviously we don’t just want to execute this once once you
Execute this before every transaction here so before every add value call for this we fetch a new input before every call with the input method and we store it in the same variable all the time and of course we should then use that variable in our add value function
So now if we save that and clear and I execute that file again I am asked for a value like 100 then 99.9 and 4.8 and once I’m done you see the 100 also present in the old value of course the 99.9 and for the date they’re all stored
In our blockchain now we’re doing one thing here which we should avoid though the one thing we’re doing which we should try to avoid is we are actually always repeating ourselves we’re calling that same code we’re executing the same code three times here now we should try
To minimize the code where we repeat ourselves and to be honest this will become easier after the next module where we learn how to loop through code and therefore repeated automatically but one thing we can already do is we can define a new function with the DEF keyword which is get user input
I don’t expect arguments here and then the function body I’ll simply execute my input statement and already converted to a float like this now obviously the value we get here is not useful inside of our function so what can we do we can return the value and by doing so we can
Simply store it in T X amount thereafter get user input like this we’re still repeating ourselves to be honest but again this is something we can fix after the next module but at least it’s shorter code now and we outsource the core functionality the input and the
Float method here into you a separate function which we now call and where we store the result which is returned with return in a new variable which we then pass to add value and with that we can execute that file and we’re again prompted for some input here and as you can
See this still works ass before but we get leaner code we’re repeating ourselves less and that really is something you should take with you try to minimize or totally avoid repeating yourselves and we’re again using a function this time again with the return statement we’re almost done with the module we
Learned a lot about functions and now also how to handle user input there’s one important concept which we already used but which I want you to understand though and that is the scope of variables and what do I mean with that we get global and local scope now what’s
Global scope if we define a variable directly in our file so on the root level so to say not inside a function like here then we can use that variable anywhere in that fall we can use it an agreed function and we could also use it
Outside of there a local variable on the apprehend is a variable only available inside of a function this would include function arguments or variables which are defined inside a function like the H variable here using this variable outside of that function would actually fail let me show this to you back in our
Code we get that block chain variable here we define it at the very beginning of our code and most importantly we define it outside of a function doesn’t matter that we define it here at the top of the file well our our code wouldn’t work but theoretically it would also be
A global function if we define it down there however the important part is as you can see we can absolutely use that variable inside a function because its global we can use it outside of it as we do here when we are printing it and we
Can use it inside of a function like we’re doing here now on the other hand local variables are seen here for example transaction amount and last transaction now these are obviously arguments of our function but in the function we use them just as variables if we try to output our
Variable outside of a function though that won’t work so if we try to output transaction amount here after our first add value call so it certainly is populated with a value if we do that if I execute the file and I enter 10 you see thereafter I get an error that
The name transaction amount is not defined the reason for this is that is indeed is not defined because it’s not a global variable it’s not defined in the file itself it’s only available in that function the same would be true for the user input by the way if we create a
User input variable in which we store the user input and then we simply return that here this will continue to work we’re just using an in-between step maybe to make it easier to read but if we now output user input here well you’re probably already guessing it but
If I repeat that execution and I enter some value I also get an error on that name user input is not defined because it’s a local variable only available inside of a function this is a key concept you also have to be aware of variables defined in a function be that
By doing it like this or as the argument are only available in that function or the other hand global variables are available everywhere in your entire file here now there’s one important thing you have to know about global and local scope and I’ll show this in the repple first of all we can
Define a function there too with the DEF keyword like print name colon and if you had enter you see three dots at the beginning you can now hit tab to indent and write your function body here and here we can of course use a local variable like name Max and thereafter
Indent again print name and we can obviously as you know you get out of the body here by hitting Enter twice you can now call print name like that and you see max now that’s not that new now let’s say we have a name here again max and this now
Is a global variable because it’s not defined inside of a function then we define a function maybe get name and here we’re prompting the user for input and we want to store that input in the name variable so name input your name like that so this will store whatever we
Enter in the name variable and thereafter outside of the function I first of all execute getname to get that input and after executing it I’ll print name so first of all let’s hit that and let’s enter Michael so a different name then is stored up here so Michael my case and
Then I’ll call print name if I hit enter we see max the reason for that is that if you use a variable in a function and you assign a value to it and that always happens if you use a single equal sign like this so variable on the left and
Then equal sign and then whatever you want to store on the right if you do that inside of a function it will always by default create a new local variable it will not store it in the global variable even if such a variable with the same name exists if you want to
Force python to do that so if you want to force it to actually restore this in the global variable instead of creating a local one there is a special keyword you can use and you have to use so if we quit this clear on the windows this
Would be CLS by the way and then we run Python again to go into the rabble let’s again try this named Max global variable and then let’s self define our function get name like this indent and now the special keyword is global and then the name of the variable name and just like
That you don’t immediately assign a value but you just tell – hey there is this global variable please if I use name in this function use the global version of that of course if no such global variable exists you’ll get a problem so let’s now enter and indent
Again and now we can again use name input your name like that and now this will actually use the global name variable because we’re telling it to do so here so now if I hit enter again and I quit this function if I now call get
Name here and I enter Michael now and I now print name you see now it’s Michael and not max anymore because thanks to global name this actually targets the global name variable instead of a new local one who we covered a lot of ground in this
Module you learned a lot about the core basics now we’ll continue diving into the basics a great place for you to all to dive deeper are the official docks which you can find on python.org make sure to pick the dot free at the free dot x docks and there the tutorial is a
Great place to learn all these basics again numbers strings lists these are things we learn about now if and so on these are things we’ll learn about in the next module so you may jump ahead if you want but there actually is no reason to do so something important or
Interesting I also want to show you from the official docks are deep apps though but what’s that if you go back to python.org and hover back over documentation and you go to Pep index you’ll find a list of all the Python enhancement proposals these are basically documents articles giving you
Hints about how you can write your Python code how you should write it new developments in future pile versions things like that now if you scroll down you’ll find the index of all the peps and you’ll find a title about well what is covered in that pet now very
Important tab is this one here pep number 8 contains the style guide for Python code click on it you find useful information on how you should style your Python code now you don’t need to learn that by heart but scanning through it is definitely recommended you’ll learn
Things like that there should be two empty lines between function definitions that you should use spaces instead of tabs which visual studio does by default and how you should name your functions and variables that lowercase thing with the underscores between the names I’m already teaching you a good style in
This course but there also might be some features we just don’t use in that course or which you’re not sure if you remember them correctly so therefore pepp 8 is a great place to dive in and learn more about these styling d our paths can be interesting but I recommend
Not going too deep into them they can be really confusing and they’re not official documentation they are req nations they are proposals if you want to learn the chloral C language watch the scores of course and fall back to the official Docs for deep dives now one thing you’ll also find mentioned
In the paps is how you comment your code and that is something we didn’t have a look at yet you can create comments in Python by using the hash symbol like here we could say initializing our blockchain list comments should be used to improve the readability of your code
But one core principle of Pi in all’s is that your code should be readable on its own so you should have clear function and variable names and your code actually shouldn’t need too many comments I’ll still add quite a lot of comments also outside of these videos
For the code which you can download so that it’s easier to understand for you but in general not many comments should be required this however is one way of commenting a common technique also is to sometimes comment out a certain value like this if you just want to test
Something without that being defined now here it just doesn’t make sense but you’ll see this occasionally throughout the course there also is a other way of commenting it and that are so-called dark strings these are essentially the multi-line strings you learn about with the free quotation marks you use them
For example at the beginning of own functions like this free opening and free closing quotation marks and in-between you comment your function like returns the last value of the current blockchain the cool thing here is most IDs actually picked this up now by default this would be a normal Python
String it’s not an official comment but it also doesn’t do any damage to your code it kind of emerged or it simply is the case now that we use this syntax to comment our own files or our own functions so we can reuse this and add
This to a function and now when we call get last blockchain value or if we use this in the IDE we actually get support as you can see if I hover over this here you see the text which I entered above so that’s very handy especially if you’re writing code
Shared with other developers and this is a good practice to comment your own functions like here append a new value as well as the last blockchain value to the blockchain and docstrings are typically all written in a way that you have a first summary sentence and if
It’s on a function like here you then all doer should add something like arguments and the exact style is up to you I’ll use digital arguments then I’ll use a colon but this again is really up to you and the name of an argument like trends action amount and then a short
Information about that argument the amount that should be added and we get a second argument last transaction the last blockchain transaction we can also add default 1 now the advantage of this clearly is that whenever we use add value we get that information and if we’re not the creator of that function
This of course is very helpful when it comes to us understanding that syntax and this is also why we get highlighting for example for input here we also get some help in the IDE well because the input is implemented like this and because it also has a dark string
Now let’s therefore complete our commenting exercise here but also adding something to get user input returns the input of the user new transaction amount as a float try to be as precise as possible so that if our developers were to use your code they can understand what’s happening so these are comments
Added for general readability and to help our developers as well as docstrings also added to help other developers but also as a general good practice to make your code easier to understand and read now when working with Python you sometimes end up with code that’s relatively long now for example this add
Value line here is a bit longer or this talk string here now for the dark string you can easily add a new line by simply hitting Enter because you can write multi-line text with triple quotation marks so that’s no problem with our code so with non common code you also can
Break lines if you’re in a list like here the arguments you’re passing you can add a new line by hitting enter after the comma and this will still be valid code now I press the autoformat’ button in my IDE you can find it in the key bindings under preferences keyboard
Shortcuts and there if you search for format it’s this format document shortcut and then you see it ordered this a bit differently it made sure that the arguments are beneath each other it would work otherwise too so if you have it indented like this it would still
Work but that’s easier to read hence that’s the formatting it applies but this is something you can do if you want to structure your code in such a way if you want to avoid long lines which you should in this course though I will typically try to put expressions and
Code into one line because once this can lead to you being required to scroll to the right a bit I believe it helps understanding what belongs together which expressions work together so that is why I tend to use one or two lines only instead of splitting everything
Across multiple lines but you can do that so that’s just a side note so that you don’t wonder why I use relatively long lines we’re scrolling can be required you have the opportunity of splitting that across multiple lines if you want to so that’s actually it for the module we
Learned a lot about Python we learned that we structure our code with indentation and colons for block statements like functions we’ll all to learn about different block statements in the next module we learned that we create functions with the special death keyword and we learned that in general
We should follow PAP eight when it comes to styling our code from a feature perspective in this module we learned about the core datatypes numbers which comprises integers and floats strings as well as boolean s– we also had a look at operators we can do some base or medic with plus minus times
And by dividing values but we also have the modulus operator which allows us to get the remainder of the division we got the floor division which always returns an integer instead of a float we got the power operator to calculate the power of a number to some other number and it’s
Important we all learned that strings can be added and multiplied multiplication only works with one string and one integer though it also doesn’t work with floats by the way we had a look at lists and we learned how we can create lists with T squared brackets that we can add items with the
Append function that we can access items with their index which starts at 0 and that we can use minus 1 to get the last value and that there are other list operations like pop and so on we saw them blink up when we used the list in
The IDE for example now also important we had a look at functions we learned that indentation and colons define the function block that we can use arguments that we can return values that we can also use default arguments which allows us to omit arguments when calling the
Function and that we can also assign values data to arguments by their names so called keyword arguments where we can reorder arguments or skip them provided that they have a default value now last but not least we also had a look at scope there is global scope for variables defined
Outside of functions and local scope for variables to find inside of functions and this is actually it now what about our blockchain status we got a chain of data we got a list of data of course only a basic implementation it’s no complex data yet but we’ll refine this throughout the
Course we’re able to mine new blocks and that of course is also something which will improve throughout the course but now mining is a big word for asking for a user input and additionally all in a basic way we’re able to hash our blocks we always got this previous data in the
Next block now we’re not really taking advantage of this we’re not really able to analyze our data based on that but it’s a nice first step and this of course is all something we’ll improve now there also are some things we haven’t even had a look at but hey it’s
Still only the first real module of this course so let’s continue to the next module and learn more about the blockchain and of course most importantly about Python you
-
Sale!
Wireless WIFI Repeater Extender Amplifier Booster 300Mbps
$29.99$14.99 Add to cartWireless WIFI Repeater Extender Amplifier Booster 300Mbps
Categories: Electronics, Wi-Fi Router, Wireless Wi-Fi Extender Tags: 300Mbps, 802.11N, Amplifier, Booster, Extender, mobile wi-fi booster, Remote, WIFI, Wireless, Wireless WIFI, Wireless WIFI Repeater, Wireless WIFI Repeater Extender, Wireless WIFI Repeater Extender Amplifier, Wireless WIFI Repeater Extender Amplifier Booster, Wireless WIFI Repeater Extender Amplifier Booster 300Mbps$29.99$14.99 -
Sale!
Full RGB Light Design Gaming Headset Headphones with Mic
$24.99$14.99 Add to cartFull RGB Light Design Gaming Headset Headphones with Mic
Categories: Electronics, Gaming, Gaming Headsets Tags: Design, Full, Full RGB Light Design Gaming Headset, Full RGB Light Design Gaming Headset Headphones, Full RGB Light Design Gaming Headset Headphones with Mic, Gamer, Gaming, Gaming Headset Headphones, gaming headset wireless, Headphone, Headphones, Headset, Light, Mic, Package, RGB$24.99$14.99 -
Sale!
Wireless BlueTooth Multi-Device Keyboard Mouse Combo
$39.99$19.99 Add to cartWireless BlueTooth Multi-Device Keyboard Mouse Combo
Categories: Electronics, Gaming, Gaming Keyboards, Keyboard Mouse Combos Tags: Combo, Keyboard, keyboard mouse combos, Mouse, MultiDevice, Set, WireKeyboard Mouse Combo, Wireless, Wireless BlueTooth Keyboard Mouse Combo, Wireless BlueTooth Keyboard Mouse Combos, Wireless BlueTooth Multi-Device Keyboard Mouse Combo, Wireless BlueTooth Multi-Device Keyboard Mouse Combos$39.99$19.99 -
Sale!
High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar
$199.99$139.99 Add to cartHigh Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar
Categories: Gaming, Gaming Chairs Tags: Adjustable, Chair, computer chairs, Desk, Executive, Gaming, Girl, Headrest, High, High Back Leather Executive Adjustable Swivel Gaming Chair, High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest, High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar, High Back Leather Executive Adjustable Swivel Gaming Chairs, Leather, Lumbar, Office, Racing, Swivel$199.99$139.99 -
Sale!
Professional LED Light Wired Gaming Headphones with Noise Cancelling Microphone
$29.99$19.99 Select optionsProfessional LED Light Wired Gaming Headphones with Noise Cancelling Microphone
SKU: N/A Categories: Electronics, Gaming, Gaming Headsets Tags: Cancelling, Gaming, Gaming Headphones with Noise Cancelling Microphone, gaming headset, Headphones, Headset, LED, Light, Mic, Microphone, Noise, Professional, Professional LED Light Wired Gaming Headphones, Professional LED Light Wired Gaming Headphones with Noise Cancelling Microphone, Wired, Wired Gaming Headphones, Wired Gaming Headphones with Noise Cancelling Microphone$29.99$19.99 -
Sale!
Gaming Desk with LED Lights USB Power Outlets and Charging Ports
$349.99$249.99 Select optionsGaming Desk with LED Lights USB Power Outlets and Charging Ports
SKU: N/A Categories: Computer Desk, Gaming, Gaming Desk Tags: and Charging Ports, Charging, Desk, Desks, Gaming, gaming desk with led lights, Gaming Desks with LED Lights, Home, LED, Lights, Monitor, Office, Outlets, Port, Power, Room, Stand, USB, USB Power Outlets, White, Workstation$349.99$249.99 -
Sale!
Wired Mixed Backlit Anti-Ghosting Gaming Keyboard
$99.99$79.99 Add to cartWired Mixed Backlit Anti-Ghosting Gaming Keyboard
Categories: Electronics, Gaming, Gaming Keyboards Tags: Antighosting, Backlit, Blue, brown, Gaming, Gaming Keyboard, gaming keyboards, gaming keyboards and mouse, Keyboard, Laptop, Switch, Wired, Wired Mixed Backlit Anti-Ghosting Gaming Keyboard, Wired Mixed Backlit Anti-Ghosting Gaming Keyboards, Wired Mixed Backlit Gaming Keyboard$99.99$79.99 -
Sale!
Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset
$119.99$59.99 Add to cartWireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset
Categories: Electronics, Gaming, Gaming Headsets Tags: 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset, ANC, Audio, Bluetooth, Cancellation, Ear, Earphone, gaming headset, Headphones, Headset, Hi-Res Over the Ear Headphones Headset, HiRes, Noise, Wireless, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Headphones, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headsets$119.99$59.99 -
Sale!
Wired Sports Gaming Headset Earbuds with Microphone
$19.99$9.99 Select optionsWired Sports Gaming Headset Earbuds with Microphone
SKU: N/A Categories: Gaming, Gaming Headsets Tags: Accessories, Earbud, Earphone, Earphones, Gaming, gaming headset with microphone, Headphones, Headset, IOS, Microphone, Sports, Wired, Wired Sports Gaming Headset Earbuds, Wired Sports Gaming Headset Earbuds with Microphone, Wired Sports Headset Earbuds$19.99$9.99 -
Sale!
150W Universal Multi USB Fast Charger 16 Port MAX Charging Station
$49.99$29.99 Add to cart150W Universal Multi USB Fast Charger 16 Port MAX Charging Station
Categories: Charging Stations, Electronics Tags: 150W, 150W Charging Station, 150W Universal Multi USB Charging Station, 150W Universal Multi USB Fast Charger 16 Port MAX Charging Station, 150W Universal Multi USB Fast Charger 16 Port MAX Charging Stations, 150W Universal Multi USB MAX Charging Station, 16 Port MAX Charging Station, 3.5A, Charger, Charging, Fast, laptop charging stations, Max, Multi, Port, Stand, Station, Universal, USB$49.99$29.99
Hello very Good work. I request for Assistance.
How can I build Mobile Wallet using Python?
why is this bullshit in a mass effect music playlist
Even a basic tutorial video is pretty much too complicated. I've just accepted I'll never make a soft using soft soft
Can you update the course in 2022?
Thanks! Bought the course to learn about Python and blockchain at the same time 🙂
1:20:36
Why didn't you say, that this is just a first part of a course, and i have to pay money to continue! Such a waste of my time.
Добрый день,я бы купил этот курс,но он на английском..Если бы вы залили его в Ютуб даже с платной подпиской,я бы купил,потому что через Яндекс можно переводить видео с английского на русский только на Ютубе..
good way to teaching
Can u make a live cryptocurrency trading app i need it for my project 😥
no such thing as easy or versatile or rich or etc or popularx or not, cepuxyuax ,any infix relatex any nmw, do, can do any nmw and any s perfect
awesome!
Thanks a lot…..
how does peer to peer work? if its tcp connection dont you need ip addresses? Im talking about cryptocurrencies. for any connection you need address . how do you set up a peer to peer connection outside your local network. aka how do cryptocurrencies actually work. Also btc has a 330gb blockchain size and its wallet only needs 7gb on your computer. thats extremely strange since its "decentralized". more sounds like there are only few machine on the network that run the 330gb file and the rest are just consumers and send the data the them (maybe mining pools or exodus servers ). who knows what actually is going on
Since making headlines after an exponential surge on the charts in the month of March, THE;TA has stagnated somewhat, with April seeing the alt trade sideways for most of the time. In fact, THETA was one of the few alts to behave this way since a majority of the altcoin market was heading north in early April. THETA had broken out of its sideways pattern, with the crypt0 breaking south on the back of market-wide corrections. THE;TA was down by almost 24% in a matter of days. What’s more, while MACD line was diverging away from the S!gnal line, the Awesome Oscillator’s histogram continued to picture a fall in market momentum. I was able to understand the knowledge of tradlng crypt0 assets early enough, but I was still limited due to my lack of techn!cal understanding of how to an@lyse the digital market, all that changed when I encountered Vincente Sanz made use of his trde s!gnal services. Although I have employed the services of many s!gnal providers, Vincente Sanz stands out with experience and expertise playing in his favor. I must confess it wasn't an easy task to learning the routes on tradlng but with the assistance of Vincente it was easier to understand. Vincente is an expert trader and finance journalist and you can find his free courses on trading on google which comes in handy as an !nvestor and he can be reached on gmαil vicentesanzofficial@gmailcom and *𝕿ℯℓℯ𝕘𝕣𝓪ℳ☞ @vincentesanz for his assistance on strictly crypt0 related concerns.
Interested in blockchaim
How up to date is all these courses. I'm interested in learning how to code along with learning blockchain.
This is EXACTLY what I was looking for to get me started. Thank you so much. I have subscribed.
I got my wallet fixed and my coins recovered with the help of GUSTAVO_TOOLS on Instagram
And he also helped me invest I think you should try him too he is the best ❤️
Time stamps would be helpfull
I’m so happy to trading in the right platform with Mr Donald brown, the help of a reliable and a trusted platform whom a friend of mine made me come across after my ugly experiences with scammers that nearly made me gave up on online investment, but thanks to God i didn't and my last trial with me Donald Brown investment brought smile back into my face getting a withdrawal just within 24hours of trade it was like a dream to me, i never knew bitcoin investment is this profitable. Now i am debts free. Please save yourself from scammers today..Mr Donald investment is the best… 💯💯
𝙒𝙝𝙖𝙩𝙨𝘼𝙥𝙥 +1(205) 442-4709,𝙏𝙀𝙇𝙀𝙂𝙍𝘼𝙈 @+447852301591
wow thats amazing if i purchase it will i learn how to have a functional webpage like in second 00:50 my project is to have a webpage in pythonanywhere that does all the basic funtions of a blockchain and give my url to different users so they can make there own blocks in my blockchain. im having a hard time coding it, help.
This is just a list and functions. I though of seeing real blockchain coding
Super explanation bro…. keep it up!
Anyway, Have you also heard about #hivetips?
People can tokenize any kind of content in the internet, emails, YouTube videos, tweets.
It also accommodates for direct tipping for all other websites without a button, but rather with manual transfers, which can all be done in an easy user friendly way via the extension.
The extension also enables people to utilize the browser as a safely encrypted decentralized means of communications with Hive. Hence cutting out the need to log into various websites for various transactions.
Download the Chrome & Mozilla extension and get #HiveTokens!
Chrome Add-ons: https://chrome.google.com/webstore/detail/hivetips/pepgdkiflaefcmpogbpjpckbbddbjamc/related
Firefox Add-ons: https://addons.mozilla.org/en-US/firefox/user/16011957/
For more info: https://www.fullalt.com/
I am intersted to buy the course. With the course you will have your own token at the end? Running on what platform, ethereum ?
Nice video, I have come to realize that with the right strategy and experience, trading crypto would indeed be very profitable. I started trading crypto one year ago. Learnt the hard way by losing a lot of money trading all alone and trying out YouTube strategies, i soon realized that i needed a proper guidance and professional help, and Mr James Carlson filled that space.He provides me accurate signals to trade on my platform. Ever since i started investing and trading through James, I have recorded a very good amount of profits. James can be reached on WhatsApp: +447476717980 and Telegram @ JamesC51 for inquiries into profitable trading system
Greatest tutor of our time.
you are funnt! I wonder where is the blockchaine in your tutorial!
00:59 aloo re lindo video me encanto deseo el siguiente grabación los dejo les dejo besitos agradecido
Hi, Max
can you make django courses on udemy that are always updated, i'm big fan of you thanks..
Thanks!
Hi Max. I just bought this course. Looks really cool – I'm super interested in both Python and the Blockchain so having both in the one course is really great and why I purchased it.
Love you man. This is so detailed. Thanks 🤗🤗🤗🤗
You lost me when you talked about the bracket 0 and bracket -1 you didn't elaborate on it.
LOL!!
Didn't like it! Not what I expected.
Your course was 10£ then went to 180£ after i watched the video…
thank you realy you are great, Max…..
best work
You ar aw sm freek,
I am a python programmer, i am learning and developing blockchain projects.
Pls tell me the scope of blockchain work from home
Just start watching and already the idea of teaching two topics together is amazing. thumbs_up = 2,462,347
which accent is this?
this is a very simple intro to a very user friendly language (function, variables , array) , it didn't even use any looks or conditional statements. What happened to the hash in each block?
Easy to understand, coherent, seamless, flawless. The absolute best lesson on programming I have taken. Thank you.
Saying python is object oriented is a bit of a stretch only because you can write object oriented code in python doesn't mean the language is object oriented
Can you provide this complete course in hindi or wanna in urdu language please beacuse most of people whom belong from south asia they dose't completely understand english I'm also one of them please help us and review this lectuer in urdu/hindi we are looking towards .