Hi, everybody, and welcome in this lecture, we will focus on practicing integer and flawed variables.
And before we begin, I must say, guys, feel free to be creative, meaning that the following assignments
can be done in different ways.
And some ways, multiple ways can be correct.
There is not only one way to solve it.
All right.
I saw before beginning.
I just want to say that I recommend you to resolve the following assignments by yourself at first take
about 30 to 45 minutes to resolve it by yourself.
And if you do that, if you see that you get into trouble, just follow the next lecture and see the
resolution there.
All right.
So let's begin.
First of all, let us create six variables, by the way, and this practice.
We're going to calculate our expense account expenses during the month.
All right.
And also, we have a calculation of a very important thing, donation to the poor.
Try to do a once in a while when I have some extra money, and that's about it.
So let's begin.
So, first of all, create six variables.
Gross salary, health insurance, rent, food, salary tax.
By the way, by the way, very important or very important to mention here, this is percent.
All right.
Just when you calculate calculate just it's not like a value toplane value like this is, for example,
ten thousand dollars or this is twelve hundred dollars.
It's not zero point two dollars.
It's a percent.
All right.
So this is very important.
We need to use I mean, meaning here that we have zero two percent, but we can't, like, create a
variable called S like salary tax zero two percent.
We can't do that because Python would not know.
What do we mean.
So I'm just mentioning that you need to create a variable that you should use later on as a tax.
All right.
But just keep in mind that it's a percent right.
If you ask me, I can give you a hint.
All right.
You can leave it.
You can leave it as zero point two and afterwards do some mathematical action of multiplying your salary.
And on this no, combined with another no.
All right, just try to think it through by yourself, but it's important to know that this one is percent
right and as well, this F variable is also a percent.
We want to give zero point one.
Let's do it like that.
All right.
Let's call it 20 percent.
Right.
It's much easier to understand that way.
And we want to donate the poor out of our net salary, 10 percent.
All right, guys, after we created these variables, let's try to calculate our net salary and print
it, meaning we have the gross salary, which is ten thousand, and we need to reduce all of these.
All right.
We need to reduce all of these variables out of the 10000 and please do not use less.
I'm just going to mention here, not for two, not for a task to.
Or maybe even use in the mosque three.
All right.
It's easier that way.
So these these donation to the poor do not use it in the calculation in this section, because you can
see here the donation to the poor is out of the net salary.
All right.
So first of all, you need to calculate the net salary.
All right.
And only afterwards.
Uh.
Only afterwards, in the third section, you should calculate the donation to the poor, so only here
you calculate, calculate the donation to the poor.
So do not use this variable in this section right in the second section.
Just use these variables only.
So after we calculated the net salary and printed it us out of this net salary, try to calculate the
amount of the donation we give to the poor.
All right.
So after we had the net salary, let's calculate the donation to the poor, which is 10 percent.
All right.
And when we are finished with this, we will get a result, which is something like this.
All right, something like this, meaning we will have whole numbers on this side, but we will have
a lot of numbers on the decimal side of the number.
And so this is a very large amount of numbers and we don't need it because if we have, for example,
one dollar, if we have one dollar and we have zero zero zero zero zero four.
So we don't care about the all these because they are they're pointless for us.
It's very small numbers.
So in the fourth fourth section, what I want you to do is to round the limit of the result from three.
Into two numbers after the decimal.
So watch what I want you to do as you're going to get a number with lots of numbers after a decimal,
and I want you to round them into only seeing two numbers after the decimal.
All right.
And we haven't studied it, but I'm not going to go easy on you guys.
I already said it.
So this one is a challenging, challenging section.
And what I want you to do is to go into Google.
All right.
And type this phrase in Google.
Once you type this phrase in Google, you get results.
Just going to give you a hint.
All right.
Navigate into the first result that you see that belongs to the stack overflow dot com website.
And why am I doing this, guys?
Why am I being hard on you with this section?
For one reason only.
This is not a theoretical course.
In this course, I'm going to prepare you to be a class developers.
And of course, the developers do not have all the information from their friends or from their colleagues.
A class developers go into Google and find answers over there.
All right.
I'm doing it on a daily basis for years now, because when I'm not knowing something, just going to
Google and typing the phrases that I want and looking for answers.
So here I'm not just throwing you into the sea, as you might say.
I'm giving you the exact phrase and I'm telling you guys, click on the first results that you see of
stack overflow and try to find your answer over there.
And don't worry if you get into trouble, because am going to show you the resolution anyway and then
following next year.
All right.
So don't worry about it.
We'll go through this.
But this is a challenging section.
All right, guys.
So we're basically done here wishing you good luck in the homework.
And I will see you in the next lecture.