$ ./guess_the_languageProblem Solving — predict the output
Problem Solving — predict the output · medium · #63

What is printed?

print(-7 % 3)
  1. 2
  2. -1
  3. 1
  4. -2
Python's modulo takes the divisor's sign, so the result is positive.
Play Problem Solving ▸