Question in the lesson 12/13


#1

In the hint,it says that"Remember that you can’t divide by 0 or you will get an error. Same goes for %. 10 % 0 will cause an error!"
Why does %.10 also cause the error?I can run my code normally.


#2

Hi @luishui1,

10 % 0 raises an error since it constitutes an attempt to compute the remainder resulting from dividing 10 by 0.

>>> 10 % 0
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    10 % 0
ZeroDivisionError: integer division or modulo by zero

#3

Ohh yeh,thank you a lot.


#4