![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
ainioders
我很快乐
展开
-
随机密码生成-Python练习
描述补充编程模板中代码,完成如下功能:以整数17为随机数种子,获取用户输入整数N为长度,产生3个长度为N位的密码,密码的每位是一个数字。每个密码单独一行输出。原创 2020-06-06 17:31:01 · 2103 阅读 · 0 评论 -
汉诺塔实践-Python
step = 1def hano(a, b, c, n): global step if n == 1: print("[STEP{:>4}] {}->{}".format(step, a, c)) step = step + 1 else: hano(a, c, b, n - 1) print("[STEP{:>4}] {}->{}".format(step, a, c))原创 2020-06-06 17:11:37 · 2413 阅读 · 1 评论 -
turtle风轮绘制
import turtle as tfor i in range(4): t.right(90) t.fd(150) t.right(90) t.circle(-150, 45) t.goto(0, 0) # 画完角度是两点之间的角度(弧点到原点的距离) t.left(135)t.done()原创 2020-05-29 15:34:58 · 348 阅读 · 0 评论 -
货币转换 I
#货币转换a=input()if a[0:3] in ["RMB","rmb"]: b=eval(a[3:])/6.78 print("USD{:.2f}".format(b))elif a[0:3] in ["usd","USD"]: c=eval(a[3:])*6.78 print("RMB{:.2f}".format(c))else: print("输入格式有误")原创 2020-05-28 19:22:08 · 763 阅读 · 0 评论