![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
练习
shebedo_
这个作者很懒,什么都没留下…
展开
-
爬虫 python基础知识(输入古诗复制古诗)
# -*- codeing = utf-8 -*- # @Time : 2021/2/11 0:31 # @Author : foryou # @File : zuoye1.py # @Software: PyCharm import os def input_poem(): try: try: f = open("poem.txt", "w", encoding="utf-8") except Exception as result:原创 2021-02-11 01:11:36 · 1255 阅读 · 1 评论 -
爬虫 python基础练习(文件的读取)
# -*- codeing = utf-8 -*- # @Time : 2021/2/10 16:58 # @Author : foryou # @File : demo7.py # @Software: PyCharm ''' f=open("test.txt","w") #read方法,读取指定的字符,开始时指定在文件头部, # 每执行一次,向后移动指定字符数 #打开文件:w写模式 文件不存在就新建原创 2021-02-10 21:44:13 · 424 阅读 · 2 评论 -
爬虫 复习python基础知识(购物车)
products = [["iphone",6888],["MacPro",14800],["小米6",2499],["Coffee",31],["Book",60],["Nike",699]] print("-"*6+"\t"+"商品列表"+"\t"+"-"*6) for i in range(6): print(i,end=" ") for j in range(2): #suojin= print(products[i][j],end="")原创 2021-02-10 02:08:43 · 278 阅读 · 1 评论 -
爬虫 复习python基础知识(老师分教室)
import random classroom = [[],[],[]] teachers = ["A","B","C","D","E","F","G","H"] for teacher in teachers: classroom[random.randint(0,2)].append(teacher) for i in range(3): print("第%d个教室有%d个人"%(i+1,len(classroom[i]))) for j in range(len(classro原创 2021-02-10 01:24:08 · 154 阅读 · 0 评论 -
2020-08-16
python绘图 import numpy as np import matplotlib.pyplot as plt data=np.arange(0,1.1,0.01) plt.title('lines1') plt.xlabel('x') plt.ylabel('y') plt.xlim((0,1.1)) plt.ylim((0,1.1)) plt.xticks([0,0.2,0.4,0.6,0.8,1.0]) plt.yticks([0,0.2,0.4,0.6,0.8,1.0]) plt.plot(原创 2020-08-16 21:23:29 · 83 阅读 · 0 评论 -
小练习
输入三边判断是否能够成三角形,若能,算出面积,否则重新输入 a=float(input("请输入一条边:")) b=float(input("请输入一条边:")) c=float(input("请输入一条边:")) while(a+b<=c)or(a+c<=b)or(b+c<=a): print("当前三边不能构成三角形,请重新输入:") a=float(inpu...原创 2020-03-11 15:20:25 · 120 阅读 · 0 评论