会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
可乐配牛奶
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
下一页
2020年4月16日
密码类
摘要: 一、凯撒密码:替换方法对信息中的每一个英文字符循环替换为字母表序列该字符后面的第三个字符,特殊符号不进行加密处理 对于原文中的字符P,其密文字符C满足如下条件: 凯撒密码的加密方法:C=(P+3)mod 26 凯撒密码的解密方法:P=(C-3)mod 26 加密第一种方法: plaincode =
阅读全文
posted @ 2020-04-16 11:31 可乐配牛奶
阅读(412)
评论(0)
推荐(0)
2020年4月8日
转码异常
摘要:
阅读全文
posted @ 2020-04-08 09:04 可乐配牛奶
阅读(83)
评论(0)
推荐(0)
2020年4月5日
利用jieba库画词云
摘要: from wordcloud import WordCloud import matplotlib.pyplot as plt import jieba # 生成词云 def create_word_cloud(filename): with open('hongloumong.txt',encod
阅读全文
posted @ 2020-04-05 22:14 可乐配牛奶
阅读(417)
评论(0)
推荐(0)
python字符串替换的2种方法
摘要: 一、python字符串替换可以用两种方法实现: 1.用字符串本身的方法 2.用正则来替换字符串 下面用个例子来实验: a = 'hello word' 我把a字符串里的word替换为python 1.用字符串本身的replace方法 a.replace('word' , 'python') 输出结果
阅读全文
posted @ 2020-04-05 10:54 可乐配牛奶
阅读(29625)
评论(0)
推荐(1)
2020年3月28日
用python实现汉诺塔问题
摘要: 一、用动画实现汉诺塔问题: import turtle class Stack: def __init__(self): self.items = [] def isEmpty(self): return len(self.items) == 0 def push(self, item): self
阅读全文
posted @ 2020-03-28 16:17 可乐配牛奶
阅读(700)
评论(0)
推荐(0)
2020年3月21日
带有进度条的圆周率计算
摘要: 圆周率的计算 计算公式:pi / 4=1 - 1/3 + 1/5 - 1/7 + 1/9 ...... 梅钦公式:pi /4 = 4arctan1/5 - arctan1/239 n=圆周长/直径 n=圆面积/半径平方 import math import time scale=10 print("
阅读全文
posted @ 2020-03-21 14:14 可乐配牛奶
阅读(487)
评论(0)
推荐(0)
2020年3月15日
使用turtle库绘制渐变的圆
摘要: import turtle as t t.pensize(3) t.pencolor("blue") t.penup() t.fd(-250) t.seth(0) t.pendown() t.fillcolor("yellow") t.begin_fill() n=10 for i in range
阅读全文
posted @ 2020-03-15 15:51 可乐配牛奶
阅读(1127)
评论(0)
推荐(0)
使用turtle库画国际象棋棋盘
摘要: import turtle n = 60 # 每行间隔,小格子边长 x = -300 # x初始值 y = -300 # x初始值 def main(): turtle.speed(11) turtle.pensize(2) turtle.penup() # 先画8*8的正方形,并按要求涂黑 for
阅读全文
posted @ 2020-03-15 15:23 可乐配牛奶
阅读(851)
评论(0)
推荐(0)
使用turtle库画太极图
摘要: from turtle import * pensize(3) penup() pencolor("black") reset() speed(10) pendown() circle(100,180) circle(200,180) circle(100,-180) fillcolor('blac
阅读全文
posted @ 2020-03-15 14:56 可乐配牛奶
阅读(1888)
评论(0)
推荐(0)
使用turtle库绘制奥运五环
摘要: import turtle as t t.setup(600,600,50,50) t.pensize(3) t.pencolor("red") t.penup() t.pendown() t.circle(45) t.penup() t.fd(100) t.seth(0) t.pendown()
阅读全文
posted @ 2020-03-15 14:32 可乐配牛奶
阅读(617)
评论(0)
推荐(0)
上一页
1
2
3
4
下一页
公告