Keyword | CPC | PCC | Volume | Score | Length of keyword |
---|---|---|---|---|---|

mod 26 in python | 0.19 | 1 | 3348 | 96 | 16 |

mod | 0.8 | 0.9 | 6335 | 51 | 3 |

26 | 1.45 | 0.1 | 8079 | 99 | 2 |

in | 0.77 | 0.7 | 9673 | 26 | 2 |

python | 1.82 | 0.3 | 8935 | 77 | 6 |

Keyword | CPC | PCC | Volume | Score |
---|---|---|---|---|

mod 26 in python | 0.2 | 0.9 | 9346 | 29 |

Your Python code, however, calculates 105 - 48 % 26, which Python, due to its operator precedence rules, evaluates as 105 - (48 % 26) = 105 - 22 = 83. To get the correct remainder modulo 26, you need to add parentheses to your Python code so that it reads (105 - 48) % 26 instead.

Basically, Python modulo operation is used to get the remainder of a division. The modulo operator (%) is considered an arithmetic operation, along with +, –, /, *, **, //. In most languages, both operands of this modulo operator have to be an integer. But Python Modulo is versatile in this case.

In modular calculations such as this, the divisor (in your case 26) must be at least the size of your character code space. Your code space is 46 characters, so that is not going to work. Any output of the modular calculation will be less than the divisor, so you will never get 83 for x mod 26, it is not going to happen.

The official Python docs suggest using math.fmod() over the Python modulo operator when working with float values because of the way math.fmod() calculates the result of the modulo operation. If you’re using a negative operand, then you may see different results between math.fmod(x, y) and x % y .