HELLO W|

kingwzun

园龄:3年6个月粉丝:111关注:0

随笔分类 -  Python

7-19 sdut-最大公约数和最小公倍数
摘要:def gcd(a,b): if a%b == 0: return b else : return gcd(b,a%b) while 1: try: a, b = map(int, input().split()) ma=gcd(a,b) print("{} {}".format(ma,int(a*
210
0
0
Python __ 循环结构
摘要:range() 函数 作用: 返回的是一个可迭代对象(类型是对象) 其实就是生成等差序列 就是类似于{1,2,3...,n}这样的序列。 用法: range(start, stop[, step]) start: 计数从 start 开始。默认是从 0 开始。 stop: 计数到stop 结束,但不
34
0
0
解决报错:AttributeError: module ‘matplotlib’ has no attribute 'figure’
摘要:引入Python绘图模块Matplotlibimport 使用了: matplotlib as plt引用了模块。 使用过程中调用 fig = plt.figure(), 报错显示:AttributeError: module ‘matplotlib’ has no attribute 'figur
1071
0
0
Python3操作MySQL数据库
摘要:前提: python3 pymysql库 若未安装,命令行执行pip install pymysql安装 基本步骤 导包 import pymysql 打开数据库连接 db = pymysql.connect(host="数据库地址", user="用户名", password="密码", port
288
0
0
python使用xls实验
摘要:导入excel表格tips_mod.xls 出现的问题: 导入文件时候报错 [Errno 22] Invalid argument: 'd:\tips.xls' 解决方案:只需要将""改为"\"即可 import numpy as np import pandas as pd fdata=pd.re
460
0
0
Python __ NumPy
摘要:概述 NumPy(Numerical Python) 是 Python 进行数值计算最重要的第三方模块。 需要引入模板import numpy as np 优点: 大部分代码是用 C 或者 Fortran 实现的,运行速度比纯 Python 代码要快。 不需要使用 for 或者 while 循环就可
75
0
0
点击右上角即可分享
微信分享提示
深色
回顶
收起