自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(123)
  • 收藏
  • 关注

原创 2021-10-24

给大家推荐一个很牛逼的网页,可以ctrl+d设为标签哦https://www.runoob.com/js/js-libraries.html这是菜鸟教程的网站,里面有很多实用的例子分享一些快捷键ctrl+0 恢复页面初始比例ctrl+上下箭头或者鼠标滑轮 放大缩小页面home键回到行头end键回到行尾tab后缩进tab+shift前缩进ctrl+home 回到文初ctrl+end 回到文末...

2021-10-24 15:51:14 175

原创 HTML使盒子边框变圆

border-radius: 10px;

2021-04-30 20:23:53 2689 1

原创 HTML怎么使盒子中的盒子置右/左

#p5{ height: 40px; width: 300px; margin: 15px auto; float: right; } delete from 置左把right换成left就行

2021-04-30 20:01:24 10981 1

原创 Django错误does not appear to have any patterns in it.

urls.py的path中的引号没有赋值,把后面name中的名字放进去加一个/就行,后续的网页地址中也要加一个index/

2021-04-17 12:07:35 936

原创 python 1201: 众数问题

from scipy import statsa=int(input())b=[]for i in range(a): c=int(input()) b.append(c)d=stats.mode(b)[0][0]e=b.count(d)print(d)print(e)

2021-03-31 11:06:09 129

原创 python求列表中的众数平均数中位数

num=[ ]众数:from scipy import statsstats.mode(nums)[0][0]平均数:import numpy as npnp.mean(nums)中位数:import numpy as npnp.median(nums)

2021-03-31 10:48:48 807 1

原创 python爬取微博热搜

import requestsfrom lxml import etreeimport timeurl=‘https://s.weibo.com/top/summary?Refer=top_hot&topnav=1&wvr=’header={‘User-Agent’: ‘Mozilla/5.0(Windows NT 10.0; Win64; x64)AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/5

2021-03-29 08:31:49 264

原创 Python用time库获取当前时间

import timeprint (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())

2021-03-28 21:58:36 852

原创 一些实用快键键

F11全屏,再按F11退出全屏Ctrl+D将当前页面设置为标签,使办公更高效windows+R 召唤出命令行Alt+p 重复上述操作Ctrl+A 全选CTRL+R 右对齐Ctrl+Home 光标快速移到文件头Ctrl+End 光标快速移到文件尾Ctrl+X 剪切...

2021-03-28 21:49:34 90

原创 python人工智能对话

import urllib.parseimport hashlibimport timeimport randomimport stringimport requestsimport sysimport readlinedef curl_md5(src):m = hashlib.md5(src.encode(‘UTF-8’))# 将得到的MD5值所有字符转换成大写return m.hexdigest().upper()“”"get_req_sign :根据 接口请求参数 和 应用密

2021-03-28 21:31:46 135

原创 Python精准的识别纸条上的文字

import requestsfrom aip import AipOcrimage = requests.get(‘https://res.pandateacher.com/python_classic.png’).contentAPP_ID = ‘16149264’API_KEY = ‘yxYg9r4OuAs4fYvfcl8tqCYd’SECRET_KEY = ‘yWg3KMds2muFsWs7MBSSFcgMQl8Wng4s’client = AipOcr(APP_ID, API_KEY,

2021-03-28 21:23:18 188

原创 利用python打开文件遇到的一些小问题

1.FileNotFoundError: [Errno 2] No such file or directory: ‘D:\record’需要将打开的文件放置python所在的根目录下(与python.exe位于同一个文件夹),而且路径必须到python的根目录(直接将目录复制为文本粘贴,需要把单斜杠变为双斜杠),查找python位置可直接window键加R打开cmd输入where python2.UnicodeDecodeError: ‘gbk’ codec can’t decode byte 0xa

2021-03-16 21:25:21 137

原创 把十进制依次转换为二进制,八进制,十六进制并不断输入

while True:a=int(input())b=oct(a)c=bin(a)d=hex(a)print(c,b,d)

2021-03-04 20:43:42 211 1

原创 python 1124: 两个有序数组合并

a=list(map(int,input().split()))b=list(map(int,input().split()))c=a[1:]d=b[1:]e=c+de.sort(reverse=-1)for i in e:print(i,end=" ")

2020-12-24 21:13:43 238

原创 python 1122: 小明的调查作业

a=int(input())b=list(map(int,input().split()))c=list(set(b)) #set()去重c.sort()d=len©print(d)for i in c:print(i,end=’ ')

2020-12-24 09:50:45 227

原创 python 1121: 电梯

import matha=int(input())b=list(map(int,input().split()))c=d=0for i in range(a):if b[i]>c:d+=math.fabs(int(b[i])-c)*6+5elif b[i]==c:d+=5else:d+=math.fabs(int(b[i])-c)*4+5c=b[i]print(’%d’%d)

2020-12-24 09:26:28 207

原创 python 1120: 最值交换

a=int(input())b=input().split()c=min(b)d=max(b)e=b.index©b[0],b[e]=b[e],b[0]f=b.index(d)b[-1],b[f]=b[f],b[-1]g=’ '.join(b)print(g)

2020-12-24 08:41:53 238

原创 python 1119: 一维数组排序

a=int(input())b=input().split()b.sort()d=’ '.join(b)print(d)

2020-12-23 22:18:30 293

原创 python 1118: 数列有序

a=int(input())b=input().split()c=str(input())b.append©b.sort()d=’ '.join(b)print(d)

2020-12-23 22:08:09 323

原创 python 向列表中添加元素

a=[1,2,3,4,5]1.append()方法添加元素a.append(), 可以是单个元素,也可以是列表、元组等,此方法会将括号里的元素视为一个整体,作为一个元素添加到列表中,从而形成包含列表和元组的新列表2.extend()方法添加元素a.extend(),extend() 不会把列表或者元祖视为一个整体,而是把它们包含的元素逐个添加到列表中,它可以是单个元素,也可以是列表、元组等,但不能是单个的数字(因为要extend)3.insert()方法插入元素a.insert(index,

2020-12-23 21:47:17 1810

原创 python 1117: 查找数组元素

a=int(input())b=input().split()c=str(input())if b.count©!=0:b.remove©for i in b:print("%4d"%(int(i)),end=’’)else:print(‘Not Found’)

2020-12-23 21:03:08 341

原创 python删除元素的四种方法

a=[1,2,3,4,5]1.根据索引值删除del a[],括号里可以是数字也可以是切片a.pop[] 括号里没数字默认删除最后一个元素2.根据元素名称删除a.remove() remove() 方法只会删除第一个和指定值相同的元素,列表中没有该元素时会报错3.全部删除a.clear()...

2020-12-23 20:19:23 1140

原创 python 1116: 删除元素

a=int(input())b=input().split()c=int(input())b.pop©e=’ '.join(b)print(e)

2020-12-23 17:54:39 179

原创 python 1115: 数组最小值

a=int(input())b=input().split()c=[]for i in b:c.append(i)d=min©e=c.index(d)print(d,e)可能方法太屌了,OJ一直说答案错误(答案绝对是对的),有不报错的方法,欢迎指教呀

2020-12-23 17:47:03 720

原创 python 1113: 递归调用的次数统计(函数专题)(0)

共勉共勉。。

2020-12-23 17:15:47 631

原创 python 1114: 逆序

a=int(input())b=input().split()for i in s[::-1]:print("%4d"%(int(i)),end=’’)

2020-12-23 17:14:01 74

原创 python 1112: 进制转换(函数专题)

a=int(input())b=bin(a)c=[]for i in b:c.append(i)d=c[2:]e=’’.join(d)print(e)能python就绝不C,魔鬼脸

2020-12-22 20:29:57 152 1

原创 python 1111: 多个整数的逆序输出(函数专题)

不定义函数:(会报错)a=int(input())b=input().split()c=[]for i in range(0,a):c.append(b[i])d=c[::-1]e=’ '.join(d)print(e)a=int(input())(也会报错,他奶奶的)b=input().split()len=b.len()while len !=0:print(b[len-1],end=" ")len -= 1print(’ ')本着能躺着吃饭就绝不坐着吃的原则,定义递归函

2020-12-22 20:08:12 491

原创 python 1110: 最近共同祖先(函数专题)

def common(x,y):if x==y:return xelif x>y:return common(x//2,y)else:return common(x,y//2)a,b=map(int,input().split())print(common(a,b))

2020-12-22 17:51:36 155

原创 python 1109: 数根(函数专题)

def digitsum(m):a=[]c=0for i in str(m):a.append(i)for j in a:c+=int(j)return ca=int(input())while digitsum(a)//10!=0:a=digitsum(a)print(digitsum(a))

2020-12-22 17:14:47 434

原创 python 1108: 打印数字图形(函数专题)(0)

卡住了,不会写,愿与诸君共勉

2020-12-22 16:52:26 743

原创 python 1107: 回文数猜想(函数专题)

def inverse(n):a=str(n)b=int(a[::-1])return ba=int(input())print(a,end=" “)while(a!=inverse(a)):a+=inverse(a)print(a,end=” ")

2020-12-21 17:19:55 512

原创 python 1106: 回文数(函数专题)

a,b=map(int,input().split())for i in range(a,b+1):c=str(i)d=c[::-1]if int(d)==i:print(i,end=" ")

2020-12-21 17:03:05 339

原创 python 1105: 判断友好数对(函数专题)

def facsum(a):b=0for z in range(1,a):if a%z==0:b+=zreturn ba,c=map(int,input().split())b=0for i in range(a,c+1):for j in range(a,c+1):if facsum(i)==j and facsum(j)==i and i<j :print(i,j)时间会超限,但总体上没问题def facsum(a):b=0for z in range(1,a):i

2020-12-21 08:32:46 433

原创 python 1104: 求因子和(函数专题)

a=int(input())b=0for i in range(1,a):if a%i==0:b+=iprint(b)

2020-12-21 07:40:10 1947 1

原创 python 1103: 平均学分绩点(函数专题)

a=int(input())f=g=0for i in range(a):b,x=map(int,input().split())if x==100:e=5if 90<=x<=99:e=4elif 80<=x<=89:e=3elif 70<=x<=79:e=2elif 60<=x<=69:e=1else:e=0g+=bf+=e*bprint(’%.1f’%(f/g))

2020-12-20 21:50:13 696

原创 python 1102: 火车票退票费计算(函数专题)

a=eval(input())b=0.05*ac=b-int(b)if c<0.25:b=int(b)elif 0.25<=c<=0.75:b=int(b)+0.5else:b=int(b)+1print(’%.1f’%b)

2020-12-20 21:33:32 351

原创 python 1101: 逆序数字(函数专题)

a=int(input())b=[]for i in str(a):b.append(i)b.reverse()s=int("".join(b))print(s+a)

2020-12-20 21:24:50 502 1

原创 python 将列表中的元素倒序的三种方法

b=[1,2,3,4,5]1,b.reverse()2,使用切片 b[::-1]3,使用 list[reversed(b)]

2020-12-20 21:02:25 5343

原创 python 1100: 求组合数(函数专题)

import matha,b=map(int,input().split())c=int(math.factorial(a)/(math.factorial(b)*math.factorial(a-b)))print©

2020-12-20 11:47:18 459 1

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除