第1章-1 从键盘输入两个数,求它们的和并输出
![在这里插入图片描述](https://img-blog.csdnimg.cn/ffc7cc8a751842b6aa6782f7344e9c21.png)
第一章-1 代码
print(int(input()) + int(input()))
第1章-2 从键盘输入三个数到a,b,c中,按公式值输出
![在这里插入图片描述](https://img-blog.csdnimg.cn/8b6e8c9e441142edbd40de5149406586.png)
第一章-2 代码
a,b,c = map(int,input().split())
print(b*b - 4*a*c)
第1章-3 输出“人生苦短,我学Python”
![在这里插入图片描述](https://img-blog.csdnimg.cn/ad4fdd8b89f64d6cb90c4b0aa3436eea.png)
第一章 - 3 代码
print("人生苦短,我学Python")
第2章-1 计算 11+12+13+…+m
![在这里插入图片描述](https://img-blog.csdnimg.cn/aaa89938080648a1aca6d30653bdd050.png)
第二章-1 代码
m = int(input())
res = (11+m)*(m-10)/2
print("sum =",int(res))
第2章-2 计算分段函数[1]
![在这里插入图片描述](https://img-blog.csdnimg.cn/6d4afa2a304949eeb6ffd1d1e2a35f8d.png)
第二章-2 代码
x = float(input())
if x == 0.0:
y = 0.0
else:
y = 1/x
print(f"f({
round(x, 1)}) = {
round(y, 1)}")
第2章-3 阶梯电价
![在这里插入图片描述](https://img-blog.csdnimg.cn/18b9015027c548f2829c0cd90fbb71a7.png)
第二章-3 代码
power = float(input())
if power < 0:
print("Invalid Value!")
elif power <= 50.0:
cost = float(power * 0.53)
else:
cost = 50 * 0.53 + (power -