小小纸箱
码龄3年
关注
提问 私信
  • 博客:63,277
    63,277
    总访问量
  • 51
    原创
  • 2,293,519
    排名
  • 88
    粉丝
  • 0
    铁粉

个人简介:Python小菜鸡正在入门,顺手点个关注,欢迎私信交流

IP属地以运营商信息为准,境内显示到省(区、市),境外显示到国家(地区)
IP 属地:福建省
  • 加入CSDN时间: 2021-09-16
博客简介:

m0_61988819的博客

查看详细资料
个人成就
  • 获得21次点赞
  • 内容获得4次评论
  • 获得151次收藏
  • 代码片获得1,516次分享
创作历程
  • 51篇
    2022年
成就勋章
兴趣领域 设置
  • 人工智能
    机器学习深度学习神经网络图像处理
创作活动更多

如何做好一份技术文档?

无论你是技术大神还是初涉此领域的新手,都欢迎分享你的宝贵经验、独到见解与创新方法,为技术传播之路点亮明灯!

357人参与 去创作
  • 最近
  • 文章
  • 代码仓
  • 资源
  • 问答
  • 帖子
  • 视频
  • 课程
  • 关注/订阅/互动
  • 收藏
搜TA的内容
搜索 取消

利用Python统计文本词频

#0705import csvpaper = str(input())paper = paper.lower()paper = paper.replace(',', ' ')paper = paper.replace('.', ' ')lst = []for i in paper.split(): lst.append(i)lst_set = set(lst)Dict = {}for item in lst_set: Dict.update({item: ls...
原创
发布博客 2022.04.29 ·
245 阅读 ·
0 点赞 ·
0 评论 ·
1 收藏

Python创建通讯录

#0704import csvn = int(input())row_list = [['姓名','联系电话']]for i in range(0,n): info = str(input()) lst = [] for j in info.split(' '): lst.append(j) row_list.append(lst)with open('Pyprog0704.csv', 'w', encoding='utf8' , newlin...
原创
发布博客 2022.04.29 ·
273 阅读 ·
0 点赞 ·
0 评论 ·
1 收藏

利用Python统计成绩

#0703LScore = int(input())UScore = int(input())import csvwith open('Pyprog0703.csv') as csvfile: reader = csv.reader(csvfile) rows = [row for row in reader]for lst in rows: a=0 for i in lst: try: i=int(i) ...
原创
发布博客 2022.04.28 ·
302 阅读 ·
1 点赞 ·
0 评论 ·
1 收藏

Python整除数据

#0702csv_file = open('Pyprog0702.csv')num=csv_file.read()csv_file.close()nList=[]for i in num.split(','): i=int(i) nList.append(i)n = int(input())for j in nList: if j%n==0: print(j,end=' ')
原创
发布博客 2022.04.28 ·
111 阅读 ·
0 点赞 ·
0 评论 ·
1 收藏

利用Python统计字母

#0701ch1 = str(input())ch2 = str(input())txt_file = open('Pyprog0701.txt','r')wrd = txt_file.read()wrd = wrd.lower()txt_file.close()m=0if ch1>ch2: max=ch1 min=ch2else: max=ch2 min=ch1for i in range(ord(min),ord(max)+1): ...
原创
发布博客 2022.04.28 ·
280 阅读 ·
0 点赞 ·
0 评论 ·
1 收藏

Python字典合并

#0608a = dict(eval(input()))b = dict(eval(input()))for k in b.keys(): a[k] = a.get(k, 0) + b[k]t = list(a.items())t.sort(key=lambda x : ord(x[0]) if type(x[0]) == str else x[0])c = str(dict(t)).replace(' ', '').replace("'", '"')print(c)
原创
发布博客 2022.04.22 ·
102 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Python验证密码

#0607password_dict={'Jone':'abc','Mike':'123','Mary':'123456','Rose':'abc123','Tom':'123456'}id,password=map(str,input().split())if id in password_dict: if password==password_dict[id]: print('Successful login') else: print('Th...
原创
发布博客 2022.04.22 ·
173 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

随机字符列表排序

#0606import randomm=int(input())n=int(input())random.seed(m)lst1=[]for i in range(0,n): a=random.randint(0,9) lst1.append(a) lst2=list(set(lst1))lst3=[str(i) for i in lst2]print(lst3)
原创
发布博客 2022.04.22 ·
96 阅读 ·
0 点赞 ·
0 评论 ·
1 收藏

统计英文单词的个数

#0605lst0=input()lst0=lst0.replace(',',' ')lst0=lst0.replace('.',' ')lst1=[i for i in lst0.split()]lst2=[]for j in lst1: lst2.append(j.upper())lst3=list(set(lst2))num=len(lst3)print('There are {} words in the paragraph.'.format(num))
原创
发布博客 2022.04.22 ·
126 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Python找中位数

#0604lst0=input()lst1=[int(j) for j in lst0.split(' ')]i=len(lst1)lst1.sort()if len(lst1)%2==0: a=lst1[(i//2)-1] b=lst1[(i//2)] c=float((a+b)/2)else: c=float(lst1[(i//2)])print(round(c,1))
原创
发布博客 2022.04.22 ·
96 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Python列表排序

#0603lst0=input()lst1=[int(j) for j in lst0.split(' ')]i=int(input())del lst1[i]lst1.sort(reverse=True)print(lst1)
原创
发布博客 2022.04.22 ·
95 阅读 ·
0 点赞 ·
0 评论 ·
2 收藏

Python实现插入元素

#0602nList=eval(input())num=int(input())x=int(input())if num in nList: a=nList.index(num) nList.insert(a+1,x)else: nList.append(x)print(nList)
原创
发布博客 2022.04.22 ·
97 阅读 ·
0 点赞 ·
0 评论 ·
1 收藏

Python计算平均年龄

list=eval(input())num=len(list)/3age=0for i in list: if type(i)==int: age=age+iaverage_age=age/numprint('The average age of {} students is {}'.format(int(num),round(average_age,1)))
原创
发布博客 2022.04.22 ·
588 阅读 ·
0 点赞 ·
0 评论 ·
2 收藏

Python检测密码强度

s=str(input())a=0b=0c=0d=0e=0for i in range(0,len(s)): f=s[i] if s[i].isupper(): a=a+1 elif s[i].isdigit(): b=b+1 elif s[i].islower(): c=c+1 elif 32<=ord(s[i])<=47 or 58<=ord(s[i])<=64 or 91&...
原创
发布博客 2022.04.14 ·
1727 阅读 ·
0 点赞 ·
0 评论 ·
9 收藏

格式化输出

c=str(input())n=int(input())ymd=str(input())i=0while i<n-1: i=i+1 print(c,end='')print(c)ymd=ymd.split('/')print(ymd[0],end='')print('年',end='')if int(ymd[1])<10: print('0',end='') print(ymd[1],end='')else: print(y...
原创
发布博客 2022.04.14 ·
91 阅读 ·
0 点赞 ·
0 评论 ·
1 收藏

Python实现单词统计

s=str(input())s=s.replace(',',' ')s=s.replace('.',' ')s=s.replace('?',' ')s=s.replace('!',' ')s=s.split(' ')s1=[x for x in s if x!='']print(len(s1))
原创
发布博客 2022.04.14 ·
569 阅读 ·
1 点赞 ·
0 评论 ·
1 收藏

字符串加密

key=int(input())s=str(input())for i in range(0,len(s)): if 'a'<=s[i]<='z': print(chr( ord('a') + ((ord(s[i])-ord('a')) + key )%26 ),end='') elif 'A'<=s[i]<='Z': print(chr( ord('A') + ((ord(s[i])-ord('A')) + key )%26...
原创
发布博客 2022.04.14 ·
69 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Python实现删除字符

s=str(input())new_s=[]for i in range(0,len(s)): if s[i].isdigit(): new_s.append(s[i]) print(s[i],end='')
原创
发布博客 2022.04.14 ·
117 阅读 ·
0 点赞 ·
0 评论 ·
2 收藏

Python提取身份证号信息

i=str(input())y=i[6:10]m=i[10:12]d=i[12:14]print(y,end='')print('年',end='')print(m,end='')print('月',end='')print(d,end='')print('日')x=int(i[16])if x%2==0: print('女')else: print('男')
原创
发布博客 2022.04.14 ·
671 阅读 ·
0 点赞 ·
0 评论 ·
1 收藏

Python查找字符

s=str(input())c=str(input())a=s.rindex(c)print('Index=',end='')print(a)b=s.count(c)print('Count=',end='')print(b)
原创
发布博客 2022.04.14 ·
112 阅读 ·
0 点赞 ·
0 评论 ·
3 收藏
加载更多