题解 | 除法与取模运算
除法与取模运算
https://www.nowcoder.com/practice/9fe22ac9e55448f4920886f84efeac58
x = int(input())
y = int(input())
print(x//y,x%y)
print("{:.2f}".format(x/y))
format()函数
# 位置占位符
print("{} 的分数是 {}".format(name, score))
# 控制小数位数
pi = 3.1415926
print("{:.2f}".format(pi)) # 输出: 3.14
查看13道真题和解析