栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

Lesson02

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Lesson02

一、Line chart

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))

 第二节课内容

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/348561.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号