What does the percentage sign mean in Python 3.1
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In the tutorial there is an example for finding prime numbers. >>> for n in range(2, 10): ... for x in range(2, n): ... if n % x == 0: ... print(n, 'equals', x, '*', n//x) ... break ... else: ... # loop fell through without finding a factor ... print(n, 'is a prime number') ... I understand that the double == is a test for equality, but I don't understand the "if n % x" part. Like I can verbally walk through each part and say what the statement does for the example. But I don't understand how the percentage sign falls in. What does "if n % x