Python 2.6,%在这个上下文中意味着什么?

Igo*_*rio 1 python syntax modulo

def f(x):
    return x % 2 != 0 and x % 3 != 0
Run Code Online (Sandbox Code Playgroud)

刚学习语言,我认为%是字符串格式化?

在官方教程中找到:http: //docs.python.org/release/2.6.1/tutorial/datastructures.html

bry*_*ryn 8

在数字的上下文中,它意味着模数 - 当你将x除以2时得到的余数是x%2.