+ 1
Plz explain me how to find remainder in python language idk much as i am a beginner in python so explain in simple language ?
Still a beginner don't have brains to understand a code.
4 Respostas
+ 5
NOTES :
This may help 😆
1. ARITHMETIC OPERATIONS:
+( Addition)
- ( subtraction)
* ( Multiplication)
/ ( Division)
// (Floor division only show int value in quotient)
Example :
100//3 = 33.33❎
100//3 = 33 ✅☑️
** ( Exponential)
5**2 = 25
% ( modulus) reminder of division
100%30 = 10
2. Comparisons operator :
5>3 ( 5 greater than 3 )
5<3 ( 5 lesser than 3)
5==3 ( 5 equals to 3)
5>=3 ( 5 greater than equal to 3)
5<= 3 ( 5 lesser then equal to 3)
5 != 3 ( 5 not equals to 3)
3. Assignment operator:
Age = 34 ( Variable assign to value)
B+=20 Also write as B = B+20
4 . Bitwise operator:
Mostly used in the set data type to
& ( Intersection)
| ( Union)
- ( Difference)
5. Logic operator:
I suggest to Refer Boolean table
+ 3
Read lesson 6.1 of Python for Beginners again. You can read the lessons as often as you like.
+ 1
Dividing is basicly adding a second number as many times as you can until you get the first number:
6/2 ..... 2+2+2 = 6 => you added 2 three times. That means 6/2 = 3
Okay sure. But what if you try:
5/2 ..... 2+2+??? Now what?
2+2+2 = 6
2+2 = 4
So you just take the smaller number and find out what you need to add to get your 5:
5-4 = 1
Now you can see that you need to add 1 to get 5. That one is what REMAINDS to add. It is a remainder.
And that is what '%' sign does. It gives you this 1.
5/2 = 2.5
5%2 = 1
8/4 = 2
8%4 = 0
Because you don't have to add anything to get 8:
4+4 = 8
BUT:
9%4 = 1
-> 4+4 = 8
->9-8 = 1
+ 1
Hi! The operator of the remainder of the number %
(for example: 17 % 3 = 2)
1. Take the nearest number when divided by 3 would be zero. That's apparently 15
2. Subtract 15 from 17 and the result is your answer. 17-15=2