What does the % in a calculation? I can't seem to work out what it does.

Does it work out a percent of the calculation for example: 3 + 2 + 1 - 5 + 4 % 2 - 1 / 4 + 6 is apparently equal to 7. How?
Oct 10, 2018 in Python 689 views

## 1 answer to this question.

The % (modulo) operator yields the remainder from the division of the first argument by the second. The numeric arguments are first converted to a common type. A zero right argument raises the ZeroDivisionError exception. The arguments may be floating point numbers, e.g., 3.14%0.7 equals 0.34 (since 3.14 equals 4*0.7 + 0.34.) The modulo operator always yields a result with the same sign as its second operand (or zero); the absolute value of the result is strictly smaller than the absolute value of the second operand [2].
• 13,300 points

## How does insertion work in Python?

Or, this one: def ins_sort(k): ...READ MORE

## How does function definition work in python?

Is it same as other programming languages ...READ MORE

## How does pillow work in opening and closing images in python?

Is there a separate library that we ...READ MORE

## difference between "*" and "**"

The "**" operator is used for 'power ...READ MORE

## how do i change string to a list?

suppose you have a string with a ...READ MORE

## how can i randomly select items from a list?

You can also use the random library's ...READ MORE

+1 vote

## how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE