Pasten-Liste
:

20190528-Python实验二 (Plain text) 2019-05-28 18:47
# -*- coding: utf-8 -*- """ Created on Tue May 28 17:00:04 2019 @author: lndx """ from matplotlib import pyplot as plt import matplotlib as mpl mpl.rcParams["font.family"]="sans-serif" mpl.rcParams["font.sans-serif"]=[u"SimHei"...
20190528-Python (Plain text) 2019-05-28 18:01
# -*- coding: utf-8 -*- """ Created on Tue May 28 16:34:36 2019 @author: Yocen """ import matplotlib.pyplot as plt import numpy as np x = np.linspace(0,10,1000) y1 = np.sin(x) y2 = np.cos(x*x) plt.figure(figsize=(8,4)) plt...
2019-05-21-python实验 (Plain text) 2019-05-21 19:25
import requests import re import io from bs4 import BeautifulSoup url1 = "http://www.ytu.edu.cn/xxyw/index.jhtml" url2 = "http://www.ldu.edu.cn/index/zhyw.htm" fytu = open("ytu_news.csv","w") fldu = open("ldu_news.csv","w") def g...
Python文件作业 (Plain text) 2019-04-22 23:21
#20190409文件读入作业 f = open("white_wine.csv","r") out = open("output.txt","w") lines = f.readlines() quality=set() dic = {} fa = {} #001输出数据的前五行 for i in range(0,5): lines[i]=lines[i].strip() print(lines[i]) ...
20190416实验002 (Plain text) 2019-04-16 18:51
#bduegf #001输出有多个出版社 fi = open("book_list.csv","r") lines = fi.readlines() fl = lines[0] pub = set() for i in range(1,len(lines)): line = lines[i] line = line.strip() line = line.split(',') line = line[-...
20190416实验001 (Plain text) 2019-04-16 17:46
#20190416001 f = open("students.txt","r") infor = f.readlines() list1 = ['学号:',',姓名:',',年龄:',',专业:',',分数"'] num = len(infor) for i in range(num): if i : line = infor[i].strip() line = line.split('\t'...
20190402实验003 (Plain text) 2019-04-02 18:19
#模块 ''' include tow functions the first function is used to find the max number in the list the second function is used to calculate the average of a set of numbers ''' import random def findMax(lst): maxx=-100000 for ...
20190402实验002 (Plain text) 2019-04-02 17:58
#3-2 #001 import math def sum(a=10,b=20,c=30): return a+b+c #001三个数都不确定 print("001 ",sum()) #002只有一个数是确定的 print("002 ",sum(20)) #003有两个数是确定的 print("003 ",sum(20,40)) #004三个数都是确定的 print("...
20190402实验001 (Plain text) 2019-04-02 17:47
#实验001 #1. import math ls1=[] for i in range(1,101): if i%2 == 0: ls1.append(i*2) else: ls1.append(i) print(ls1) #2. ls2=[i*i for i in ls1] print(ls2)