Boolean Expressions.
A Boolean expression is a logical statement that is either true or false.

The above image has 4 bool statements. For bool2, 3 * 3 is equal to 9, which is true but bool4 means that 3 * 3 is not equal to 9, which is obviously false. In layman terms, boolean expressions are statements whose results are either true or false.
print(type(def function)), is how you print out what of variable is stored in the function.
NB: There is a difference between True and “True”. The first is a boolean while the other is a string, characters within quotes are seen as the type of string.
As shown below:

You will use boolean expressions in exploit development, loops and conditional statements. Conditional statements, if something is true, then run a certain code and if it’s false, run a different code.
Now, let’s build upon this. Just remember, every time you hear or see boolean expressions, it’s simply either True or False.
Relational and Boolean Operators.
A relational operator takes two non-Boolean primitive operands, compares them and yields true or false.
In English, a relational operator compares two expression and determines if they both are true or false (returns a boolean value). For instance, we want to compare if (7>3) and (4<9), a relational operators compares both to see if they are true and return the appropriate boolean expression. In this case, both are true, making the entire statement true.
In a case where one is false and the other is true, the entire statement will be false, the “and” is what determines that.
To know if a statement with two expressions are true of false:
• In the instance of OR, the outcome if true, if both expressions are true.
• Still for OR, if one or the other expressions are true, then the outcome is true.
• For the outcome of OR to be false, both expressions have to be false.
• In the instance of AND, both expressions have to be true, in order for the outcome to be true
• Still AND, if one of the expressions are false, the outcome of the comparison becomes false

I highly recommend going out on the internet to study this, it can be a bil confusing at first. Make sure you understand them, cause we’ll continue to build on them as we go along.
Don’t only focus on True and False, but the greater/less than symbols, and/or & not
The goal of learning Python is not essentially to be a developer, which is not as important, but being able to read and understand what is going on or what you see, is very important.
You can start here, with a true false chart.

Moving on.
Conditional Statements.
Here we’ll learn how to make “decisions” in Python. This is the moment when you can use Python for more than just an ordinary calculator.
A conditional statement is a set of rules performed if a certain condition is met. It is sometimes referred to as an If-Then statement, because IF a condition is met, THEN an action is performed. Like: IF a value is less than 20, THEN display the words “Value is less than 20” on the screen.
Here’s an almost everyday scenario:
You head over to the store to get some cookies and the drink costs $5. If you have $5, you’ll be able to get the cookie but if you don’t, then you won’t be able to purchase it.This is a condition, which is based on the amount of money you have. With these conditional statements, we can run, if, else and if elseif and so on.
OK let’s go ahead and add it to our script

Let’s look at a scenario with multiple parameters:
You are an adult, and in the USA you have to be 21 years to be able to get an alcoholic drink. In this scenario, you have to be both of age and have the right amount to purchase your drink. (If you don’t drink, that’s fine, I don’t either but this is just a realistic example)
In this example, we have multiple conditions:
• Have the money and of age.
• Have the money but not of age.
• Don’t have the money but of age.
• Don’t have the money and not of age.
Here, I’ll introduce elseif, which is written as ‘elif’. Elif is used when there are more than two conditions, so you can have multiple elifs in your code.

This is it for conditional statements, and hopefully this made sense to you.
What you need to be thinking about is what are the different scenarios that could happen in these situations, think of the logic behind them,. So when yore building out a script or your first program, you need to think logically. Like, if I make a conditional statement, what’s the logic behind it? What are the different possible scenarios and there outcomes? Just think it out in plain English, for it to make sense to you, before writing it out in code.
Make sure you practice, you’ll understand better, and it’ll get easier to read and write codes with multiple scenarios.
Lists.
List is just a collection or grouping of items, which are changeable and ordered. Those items can be anything in python, it could be strings, floats, integers, boolean values, dictionaries. Everything inside a list is called an item, and they are always in brackets, just as strings have quotes around them.
NB: Brackets [], not parenthesis ().
Open up the Python script we’ve been building on and lets make a list of a few countries, then we’ll print out just one of the countries from the list, and see what we get.

Notice, it didn’t print out the first item in our list, which is “Australia” but printed “Norway”. This is because, computer scientists usually count from 0, most programming languages also count from zero. Fortran and Visual Basic are notable exceptions.
“Norway” is, according to programming numerical order, the number one item in the list.
If [1] prints out the second item on the list, how do you think we’d print the first item? Yes! you’re right, well only if your answer was zero [0].
Lets try that out, just to see:

Don’t forget that counting starts from zero [0], which is the beginning number.
Alright, lets do a few more prints with different parameters. What if we wanted to print out a certain range of items in our list, for example, [0-3]. How do you suppose we’d go about that and what do you think our result would be?
Lets take a look, shall we:

Oh but I put in zero to three [0:3], and yet it printed [0, 1, 2] and not [3]. Why?
That’s because, it starts at the first given number of the item in the list but ends before the last given number.
Okay, now in plain words:
When you want to print a couple of items out, the first number you place in the bracket should be the item you want to start with and the last number should be the number you want to stop at..
So, in my example if I wanted to print out “Canada” too, it’ll be [0:4], not 0:3].

I encourage you to create a longer list and play around with this. By now, you should know that I’m big on practicing what you’ve learnt, ’cause you’ll get a better understanding.
To print out all the items in a list, we use, in my case, print(countries[0:]). It doesn’t matter how many items are in your list, they will all be printed out.

“Australia” is printed out because, as explained before, it prints out the first item “Australia”, and stops the the number of the last item. So [:1}, prints out the first item and the item before [1], which also happens to be the first.
Lets try printing beyond [1] and see the outcome:

To grab the last item in a list, in my case, print(countries[-1]). It doesn’t matter how many items are in your list, it’ll grab the last one.
It’s important for me to state that, you probably won’t use this as often as you think but I promised to go through the basics. So, yeah.
Lets look at len, we’ve looked at this in strings, it printed out the number of characters in the string.
To print out the length of a list:


The above is how to add (append) to a list, Items are appended to the very end of the list.
What if we wanted to delete something from our list?

The ,pop(), deletes the last item in a list, to delete any other item in a list, specify its number in the parenthesis.
Please PRACTICE! PRACTICE!! PRACTICE!!!
Overview:
• Lists have brackets.
• Inside the brackets are things called items
• Items in a list start with zero (0) and not one (1)
• There are different ways to grab from a list.
Coming up next is Tuples and looping.
Until next time, Keep learning, Keep hacking! And don’t forget to breathe.