【Python】"%"代表的意义


Python 中 "%" 的含义

# 第一种:数值运算 -- > 求模
print(1 % 3)

> 1 

# 第二种:格式化字符串
print("输出:%s" %"3.14")

>  输出:3.14

JAVA中% 称三目运算符(取余)