+ 2
Python: what is %
What is %
13 ответов
+ 4
Frugally , X%Y is the remainder of dividing X by Y .
+ 9
Khaled Alsaadi ,
can you please post a snippet with the code that contains the '%' character?
it can have different meanings:
> ... 7 % 5 => it is used as modulo operator
> datetime.strptime(dt_string, "%m/%d/%Y") => it is used as a placeholder for date or time conversion
you can try to use the search bar in sololearn. go to *discuss*, then select *most resent*. click on the searchbar and enter '% python'.
+ 5
Kimberley ,
may be you are confused by whatever.
*** your assertion that 26 modulo 6 equals 1 is completely false ***
you can see the results in the small code snippet, and what a surprise, python in sololearn and in any other code editor is giving the same correct answer.
print(26 % 6) # result => 2
print(26 // 6) # result => 4,
# proof: 26 - (4 * 6) => 2
also your assertion that 50 divided by 5 has no remainder is not correct. it has a remainder that is 0.
+ 4
Malchiel Nkhata ,
first of all you have to decide what kind of program you wanted to do. if you like to learn a programming language, you could start
with *python for beginners*. you will learn all the basics of this language.
you can find the python tutorial here:
https://www.sololearn.com/Course/Python-for-Beginners/?ref=app
+ 3
https://www.sololearn.com/discuss/2190788/?ref=app
https://www.sololearn.com/discuss/2102693/?ref=app
https://www.sololearn.com/discuss/2967456/?ref=app
https://www.sololearn.com/discuss/2139117/?ref=app
+ 1
The modulo operator is generally used to get the reminder
>Print (5 % 2)
Output: 1
+ 1
% men's remainder for example 5%2 is 1 2*2=4 remainder 1 so ans 1
+ 1
The remainder of a division operation.
E.g 9/2=4 remainder 1.
The 1 is the % in python.
0
Help Guys,how can start learning coding starting from the bigginig
0
%is a modulo operator, used for getting remainder when we divide 2 numbers
Example: 5/2 here quotient is 2 and 5%2 here remainder is 1
0
The symbol '%' in math equation is simply a rainier and that means when you devide a number by another
In a simpler way, in the equation: 26%4, multiply the number 4 until it is near to 26, and that will be 4*6 : 24, then minus 26 from 24 and the remainder is 2.
And if we have the equation 24%4 the result will be 0 because it has no remainder as it can be multiplied by 4.
Hopefully I have explained it in a good way, I might have some small mistakes but the main idea is clear hopefully.
0
It's is the Mod of an operation
0
No % = 1 (remainder of the divisional operation)