Hola Everyone, the Previous day we learned about how everything in Python is an object and about Mutable and Immutable Datatypes. If You haven’t the go through the link and read about them and come back again to join us.
Today we will be talking about Conditionals and Loops.
So first let me tell you all about Conditionals. Python provides two ways to treat conditionals. The first one is the native way.

Another one is the clearer, and the developers of Python tried to make it simpler and easy to understand.

Now let me tell you about some of the operators.
Python has a variety of operators like ( You can read about them from this link)
+ , – , += , == , != , AND , & . . . . . . . .
There is another type of operators called Special operators.
is
is not
So how these special operators different from ‘==’ and ‘!=’
is operator compares the id. Whereas == operator compares the value.
As I have told earlier that numbers are immutable.

Since we know that numbers are immutable so both X and Y have the same id and as well as same value so both == and is are returning TRUE.

Since dictionaries are mutable. So even though both X and Y have same values their Id’s are different. Therefore, X is Y returns False here but X == Y is returning True.
Now let’s learn about Loops in Python. Basically, Python has 2 types of loop. One is WHILE loop and other is FOR loop.

This is a simple implementation of While loop. What while loop does it that it checks for the condition and if it is true it executes the suite of code and after that, it again checks the code and runs the suite until the condition become false.
For loop is little different. It iterates over the objects.


What for loop is doing that it is iterating over the objects till the iterator is out of stuff to iterate. The line object takes each line and prints it. Here fh.readlines() reads each line until the end of the file.

In a nutshell, Range function generates a list of numbers, which is generally used to iterate over using for loop.
I will be talking about other iterators in upcoming write-ups. Thanks for reading.