Comments in Python
The purpose of comments is to explain what is happening in the code. Comments are written along with your code but do not influence your program flow. When you work by yourself, maybe comments don’t feel like something you should…
The purpose of comments is to explain what is happening in the code. Comments are written along with your code but do not influence your program flow. When you work by yourself, maybe comments don’t feel like something you should…
Conditionals are one of the cornerstones of any programming language. They allow you to control the program flow according to specific conditions you can check. The if statement The way you implement a conditional is through the if statement. The…
As far as data types go, the Boolean type is by far the simpler one. A boolean typed variable is either Trueor False. Notice the capitalization, that is how you should write these values in Python, not "true" or "false".…
In any program, you need to store and manipulate data to create a flow or some specific logic. That’s what variables are for. You can have a variable to store a name, another one to store the age of a…
To store data in Python, you need some variable, and every variable has its type depending on the value of the data stored. Python has dynamic typing, which means you don’t have to explicitly declare the type of your variable,…
A Python lambda function can only have one expression and no multiple lines. It is supposed to make it easier to create some small logic in one line instead of a whole function as it is usually done. Lambda functions…
There is this weird syndrome some people seem to have that I call TSTC: Too Scared To Code. This condition can come in various forms. It makes you avoid coding in any way, you doubt you will be able to…
The best way to use command line arguments on your Python script is by using the argparse library. Step By Step First import the library import argparse The initialize a parser object parser = argparse.ArgumentParser(description='Find out the number of World…
In this tutorial, I will show how to handle files in Python. Create, write, read, append and close files. File create First things first, create! We are going to use the open() function. This function opens a file and returns…
What is a Monolith? A Monolithic system is designed to produce one, self-contained, deliverable. This deliverable will then be deployed in a whole bunch of different environments to be tested, validated, and finally, go to production and serve its users.…