+ 4
Quotient and remainder in python ex:20//6=3 while 20%6=2
// = ONLY gives you NUMBER OF TIMES and ignores remainder. Example: print(20//6) = 3 % = Ignores the result and ONLY gives you the REMAINDER. Example: print(20%6) = 2
6 Respuestas
+ 7
sorry i fixed everything
first its python second its about quotient and remainder ok .
20÷6 if want it to make a code for it it will be ,print(20//6) because the dividing mark in python is / or // the difference is that the first one will produce a float(decimal) and the second willnot produce a float or a decimal .
but it doesn't change the result . back to 20//6=3 cause 3×6=18 but there's a remainder which we can get it by doing this 20%6=2 which is the remainder.
let's code it print (20÷6) wont work but print(20/6) will work and will produce you a float while this code print(20//6) won't produce a float to you .
print (20//6)
>>> 3 which is the number in an integer form .
print(20/6)
>>> 3.0 which is the number in decimal (float) form
print (20%6)
>>> 2 which is the remainder
note don't put any quotes because they will
print you the things that written inside them
ex: print ('20//6)
>>> 20//6
but if you will make it on your calculator it will be 3.33333333333333333333333333333333333333333333333333333333333333333333333333333333333333 a loop for ever
+ 4
This post is very confusing
what language is this and what is the topic about
add some tags and a (hope I don't sound rude) meaningful title
+ 1
thanks for your support I am now one of your followers
+ 1
thanq
+ 1
I didn't understand please tell me clearly
0
Hlo anyone one please tell me clearly