Lesson02

一、Line chart

'''
功能:作折线图     function
作者:Sherry        author
日期:2021年10月9日  date
'''
import numpy as np
import matplotlib.pyplot as plt
temperatures = np.array([17,20,36,20,22,19,36,20,32,28,29])
plt.plot(temperatures)
#输出之后有一个反馈
plt.show()
'''
x = np.linspace(-np.pi,+np.pi,100)
y = np.sin(x)
plt.plot(x,y)
plt.show()
'''

效果图:

 二、Sum

'''
功能:两个整数求和     function
作者:Sherry        author
日期:2021年10月9日  date
'''

# 输入部分·input
a = int(input("a = "))  # -- in pair
b = int(input("b = "))

# 处理部分 -process
sum = a + b

# 输出部分 -output - product
input(sum)
print("sum = %d" % sum)
print("%d + %d = %d" % (a, b, sum))
print('{1} + {0} = {2}'.format(a, b, sum))
print('{0} {0} {0} {0}'.format(sum))

'''
Ctrl + D        --行复制
Ctrl + x        --行删除
Shift + Enter   --直接换行
Ctrl + Alt + L  --添加空格(美化格式’现仅pycharm可用‘)
'''

 三、HomeWork

Cirle:

'''
功能:计算圆的周长与面积。
作者:Sherry
时间:2021.10.10
'''
import math
r = float(input('r = '))
C = 2 * math.pi * r
S = math.pi * r **2
print('圆的周长是%.2f, 圆的面积是%.2f' %(C, S))

 第二节课内容

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

猫腻余腥

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值