A Guide to Writing Comments in Python

Reading Time: 4 minutes

What is a Comment?

python-logo

In simple terms, a comment is an entry added to the source code to allow a deeper understanding of the logic behind why the code was written the way it was. In Python, the ‘#’ or pound symbol is required before every comment. This symbol allows the Python interpreter or compiler to ignore the pursuant text. 

Why are Comments Needed?

When working in a large codebase, a developer may need to refer back to the information in comments weeks or months later to ensure that they understand the code’s original purpose. This information is necessary for the original idea’s formal logic aspect and is an essential criterion when working with other developers on an extensive project. 

Continue reading “A Guide to Writing Comments in Python”

How to Create a For Loop in Python

Reading Time: 7 minutes

What is a For Loop?

python-logo

A for loop in Python is utilized to make repeated use of a function or procedure, applying it each time to the result of the previous sequence. This repeating process is called iteration. The for loop checks each iteration until a condition is met. Typically these are used when we have to run a block of code duplicating it X number of times. Each time it iterates over a sequence, it re-executes the code.

Syntax of a For Loop

Continue reading “How to Create a For Loop in Python”

What Is a Python Function? A Tutorial

Reading Time: 7 minutes
python functions

What is a Python Function? 

In this tutorial, we discuss one of the most useful attributes of Python: the function. Python functions are considered “First Class” objects. A First Class object can be assigned to variables, stored in data structures, passed as arguments to other functions, or even return values from other functions. Other examples of First Class objects in Python are integers, strings, and dictionaries.

Continue reading “What Is a Python Function? A Tutorial”

What Is A Function?

Reading Time: 3 minutes

In this article, we are going to discuss what a function is, the ways a function can be used, and how it relates to programming. In essence, a function refers to how the values of one variable parameter relate to the outcome and amount of another parameter. 

Continue reading “What Is A Function?”