Mayungo Mayu Mayu
This time we will calculate the numbers because it is the 5th episode.
The same video is available, so please have a look if you like.
Use "+" when adding on python.
It's the same as when we usually calculate.
print(5 + 2)
7
When I calculated it with 5 + 2, it became 7.
Subtraction also uses "-" as in normal calculations.
print(5 - 2)
3
If you calculate with 5-2, 3 will come out.
It's a little different from multiplication.
Use "*" instead of "x" for multiplication.
print(5 * 2)
10
It is necessary to use them properly in division. First, "/".
print(5 / 2)
2.5
If you try to calculate with this, the decimal point will come out.
the other one is"//".
print(5 // 2)
2
If you do this, you will see integers and no decimals.
Even if the expression is divisible by an integer, it is necessary to use it properly.
Use "%" for the remainder that is not divisible.
print(5 % 2)
1
Use "**" to get a power.
For example, to get the square of 5, write 5 ** 2.
print(5 ** 2)
25
print(5 ** 3)
125
The number that comes after "**", not the number of "*", is the number specified as the power.
Finally, it is the reversal of positive and negative.
Put 114514 in the variable message.
If you add "-" here, the positive and negative will be reversed.
message = 114514
print(-message)
-114514
This time I touched on numerical calculation. Thank you for subscribing to the channel.