每日python练习[2021.7.15](python中判断一个数能否被4整除) n=int(input())if n%4==0: print('能被4整除')else: print('不能被4整除')
用wordcloud生成中国地图 前言废话不说,直接上代码。代码import wordcloudimport matplotlib.pyplot as pltimport numpy as npfrom PIL import Image# 读取模板图片(中国地图)mask=np.array(Image.open("map.jpeg"))# background_color:指定词云图片的背景颜色,默认为黑色;repeat:词语重复;max_words:要显示的词的最大个数;height:输出的画布高度,默认为200像素;
python3统计字符串在文本中出现的次数(支持同时多个字符串) 前言学校老师要求统计人物在小说中出现的次数,我从网上找了一下脚本,并附上注释。代码import sysimport reprint()# 此处的“\033[33m”是python的颜色特效控制,具体使用方法看下文的相关链接obj_file = input("\033[33m请输入文件路径及文件名:\033[35m");"\033[0m"print()obj_str = input("\033[33m请输入要查找的字符或字符串,多个以空格分隔:\033[35m");"\033[0m"pr
腾讯云纯手工搭建LNMP+WrodPress教程(非宝塔,超详细) 文章目录搭建Lnmp1.vps信息2.创建root用户3.系统升级&更新源4.Mysql安装Mysql登录 Mysql创建及配置 wordpress数据库5.安装 PHP6.安装Nginx7.配置 Nginx解析PHP8.创建 PHP文件以测试配置9.安装phpMyAdmin(可略过)安装WordPress1.下载WordPress2.更改默认后台登陆页面路径(防止爆破)3.FTP上传WordPress4.配置WordPress申请SSL证书(未待续)绑定域名(未待续)参考文章搭建Lnmp1.v
每日codingame小游戏练习[2021.4.21](python3入门学习之生成三角形) 题目描述无文字描述,看实例写代码eg1:InputOutput11eg2:InputOutput2222eg3:InputOutput3333333eg3:InputOutput3333333<>eg4:InputOutput44444444444eg5:InputOutput5555555555555555题目分
每日codingame小游戏练习[2021.4.19](python3入门学习之字符互换) 题目描述无文字描述,看实例写代码eg1:InputOutput10001110eg2:InputOutputr*rrr***rrrrrr*rrrrrrrrreg3:InputOutput$%%%%%$$%%$$$%%%eg4:InputOutput’’eg5:InputOutputx=x=x=xxxxxxxxxxxxxx==x=x=xxxxxx=xxxxxxx
每日codingame小游戏练习[2021.4.17](python3入门学习之计算字母下标) 题目描述Sum the alphabet index of each character in the given wordeg:InputOutputMath42题目分析题目要求我们求26个字母的下标,a的下标为一,然后下标相加。解题代码我的代码:list1=['_']for i in range(97, 123): list1.append(chr(i))list2=[]j=''for i in list1: j=i.upper()
每日codingame小游戏练习[2021.4.14](python3入门学习之十六进制转十进制) 题目描述文字描述我没有记录下来,具体要求就是把16进制转成10进制。eg:InputOutputF15题目分析这是我遇到过最简单的题目,直接上代码。解题代码我的代码:import sysimport mathn = input()h='0x'+nprint(int(h,16))印度阿三的代码import sysimport mathnumber = input()print(int(number,16))总结代码大同小异,肯定用int
学习正则表达式入门笔记 文章目录第一章:什么是正则表达式?例:提取文字中的薪资补充知识相关链接第二章:正则表达式常见语法普通字符特殊字符点.-匹配所有的字符星号*-重复匹配任意次加号+-重复匹配多次花括号{}-匹配指定次数问号?问号第一种用法-令标记变慵懒尽可能少地匹配字符贪婪模式和非贪婪模式问号第二种用法-匹配0个或1个前面反斜杠\第一种用法:对元字符的转义第二种用法:匹配某种字符类型方括号[]-匹配几个字符之一^-匹配文本的起始位置起始位置和单行、多行模式$-匹配文本的结束位置括号()-组选择第三章:正则表达式的一些使用技巧使
每日codingame小游戏练习[2021.4.09](python3入门学习之字符串换位) 题目描述For each pair of characters of the text swap the two characters.eg:InputOutput01ABxy10BAyx题目分析题目要求我们把字符串中的字符交换位置,直接上代码。解题代码好容易遇到一道简单的题目,但是我还是没能在规定时间内写出来,下面是我的代码:import sysimport matht = input()j=list(t)x=0if (len(t)%2)==0:
2020年强联杯under_your_nose[WriteUp] 前言强联杯是我参加的第一个线下赛,这道题使我印象深刻,最近重做了一下,写下WP以此记录。WriteUp其实放大图片就可以看到,图片中有很多白色的像素点,仔细看会发现每个白色像素点在宽和高上都间隔了20个单位的像素点,我们要做的就是把像素点提取出来拼接在一起。下面我就直接放上我学校实验室大佬写的解题脚本。import cv2 img = cv2.imread("under_your_nose.jpg") i = 0while i <= 1884: #图片高为1904,1904-20=1
每日codingame小游戏练习[2021.4.08](python3入门学习之杨辉三角形) 题目描述Print rows rows of the Pascal’ s triangle but make the first number start he Pascals triangle is a triangle which has one 1 on the top , 2 ones below that . and for the next few rows are the sum of the two numbers above it . There should not be spaces
每日codingame小游戏练习[2021.4.07](python3入门学习之三数取最大) 题目描述题目的文字描述我没有记录下来,不过看例子也够了。eg:InputOutput1 2 3321题目分析题目的要求是让我们输入三个数,然后把他们从大到小输出。解题代码题目我想的实现方法比较复杂,就是把每一种情况都写出来,但其实不用那么复杂,下面直接放我搜到的代码:1.# 利用列表的max()函数来比较大小numbers = []l=[]numbers = input().split()for i in range(len(numbers)):
每日codingame小游戏练习[2021.4.06](python3入门学习之等比/等差数列) 题目描述Find the N th termgiven arithmetic or geometric sequence s.Input:An integer NA space-separated line of integers representing the first 6 numbers of the sequence s.output:The N th term of the sequence as an integer . Note that the sequence is O-i
每日codingame小游戏练习[2021.4.05](python3入门学习之二进制取反&&三目运算) 题目描述The goal is to flip all bits of a number .Do not flip leading zeros .Example :You have 9Then the binary number is 1001If we reverse all bits , we obtain 0110So 0110 is 6.The answer is 6.eg:InputOutput96题目分析题目让我们把二进制取反,直接上代码。解题
每日codingame小游戏练习[2021.4.04](python3入门学习之时间单位转换) 题目描述Input an N.Formatted time corresponding to the N value , according to the format : hh mm ss ii( h : hours , m : minutes , s : seconds , i : milliseconds )eg:InputOutput4529678912 34 56 789题目分析题目要求我们输入毫秒,然后把输入的毫秒转化成(时:分:秒:毫秒)的形式。解题代码
每日codingame小游戏练习[2021.4.03](python3入门学习之提取字符串中的数字) 题目描述无文字描述,看实例写代码。Test 1:InputOutput1Hello World!0Test 2:InputOutput21337 5p3k 15 c0015pr34d 7h3 w0rd!116Test 3:InputOutput2abcd1234a1b2c3d444Test 4:InputOutput2xxxxxxxxxx1111111111010题目分析题目很简单,
每日codingame小游戏练习[2021.4.02](python3入门学习之int()方法) 题目描述Here a short step by step process:ABCZ A 6510000016 0 60 B 6610000106 0 61 c 6710000116 10 610 z 9010110106 43 160 61 61 6431The message " ABCZ is transform to"60 61 610 6431".You get an unreadable message like
每日codingame小游戏练习[2021.4.01](python3入门学习之凯撒密码) 题目描述In Caesar Code you take every letter of the given text and move them forward by the integer k in the alphabet. (Attention: After z comes a)Example:Normal text: “hello”k = 2h -> je -> gl -> nl -> no -> qEncrypted text: “jgnnq”C
Windows基础 Windows系统目录windows:系统文件里边存着系统的所有信息和重要文件,删除这些文件系统则无法工作program files:程序安装目录perfLogs:是日志信息,如磁盘扫描错误信息,删除可以,但不建议删除,删除反而会降低系统速度,PerfLogs是系统自动生成的。Windows目录详解Windows工具cmd:打开cmd窗口mststc:打开远程桌面(端口:3389)gpedit.msc:打开Windows本地组策略编辑器services.msc:打开Wi