As you can see by the image, we are continuing with "if" statement, but this time it works different. The first "if" statement in this case is false, then thats when we get to the elif, this is another if statement just inside that if statement, if one of the elif's are true then it will stop there, execute the code insde the scope of that if statement then move on the next section of code
When it comes to elif's thet only go after a if statement, and never before there will be a error if that was to happen.
Dont forget to join the discord channel if you need help
In this part we will be going over more on variables and printing them.
So let's make a variable and give it the value of 10, so it should look something like this X = 10, X could be any word really just not a reserved word, here is a link to a website with alot of reserved words that can't be used https://realpython.com/lessons/reserved-keywords/.
and scroll down a little and you will see key words.
Once you have the variable made let's print the variable.
So like before very simply print(x), as you can see in the image above. Now lets run and se the output which in this case be 10.
For todays part we, are looking at basic numerical operators. In the image i have created 2 integer variables and then in the print i have used both variables and then used the operator inbetween them, so to add them we use '+', to subtract '-', mulyply '*' and finally divide '/'.
As you can see by the outputs it has worked, so 10 + 5 = 15, 10/5 = 2. These are basic operators for python, you can perform squaring and so on but thats for future content.
Next lesson will be about what happens if you added a string and integer together.
Dont forget to join Discord for help.
Just like last week i have created a for loop, but instead of only one number in the brackets.
The first number is the starting value and the second value is the highest, so in this case i have put 10, 100 so the range is 10 to 99, the last number which i put as 5, is the steps, so every 5 numbers it will do what is in the for loop. This could be any number range, plus it can go the other way aswell, so when you make the for loop in the pair of brackets put 100, 0 , -1 and it will count down instead.
For loops can also be used to iterate through lists, but that is the next lesson
❤️ Brainstash Inc.