python中%:

1. 求模运算,相当于mod,也就是计算除法的余数,比如5%2就得到1。

2. %还用在python的格式化输出,比如:

a = 'test'
print ('it is a %s' %a)

   打印的结果:

>> it is a test

更多推荐

python中%代表什么意思?