摘要: n = int(input())count = 0def han(n,a,b,c): global count if n == 1: print("将第{}个从{}搬到{}".format(1,a,c)) count += 1 else: hanoi(n-1,a,c,b) print("将第{}个从 阅读全文
posted @ 2020-03-31 19:54 Xiao_kong 阅读(124) 评论(0) 推荐(0) 编辑
摘要: import mathimport timescale=10t=time.process_time()for i in range(scale+1): a,b='**'*i,'..'*(scale-i) c=(i/scale)*100 π=4*(4*math.atan(1/5)-math.atan( 阅读全文
posted @ 2020-03-25 16:14 Xiao_kong 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 写一个你自己的turtle 库的学习笔记 1.turtle库的简单介绍 turtle(海龟)库是turtle绘图体系的python实现,turtle库是一种标准库,是python自带的 turtle(海龟)是一种真实的存在,有一个海龟在窗口的正中心,在画布上游走,走过的轨迹形成了绘制的图形,海龟由程 阅读全文
posted @ 2020-03-24 12:44 Xiao_kong 阅读(494) 评论(0) 推荐(0) 编辑
摘要: N = eval(input())flag = 1while(flag): C = 0 while (N != 0): C = C + pow(N%10,2) N = int(N/10) N = C if N < 10: flag = 0if N == 1: print("True")else : 阅读全文
posted @ 2020-03-24 12:31 Xiao_kong 阅读(221) 评论(0) 推荐(0) 编辑
摘要: n = eval(input(""))t = pow (1+(n/1000),365)a = pow (1-(n/1000),365)b=t/aprint("{0:.2f}, {1:.2f}, {2:.0f}".format(t,a,int(b)),end="") 阅读全文
posted @ 2020-03-23 21:39 Xiao_kong 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 描述读入一个整数N,分别计算如下内容:‪‬‪‬‪‬‪‬‪‬‮‬‪‬‮‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‮‬‪‬‪‬‪‬‪‬‪‬‮‬‭‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‭‬‪‬ 1. N的绝对值;‪‬‪‬‪‬‪‬‪‬‮‬‪‬‮‬‪‬‪‬‪‬‪‬‪ 阅读全文
posted @ 2020-03-23 21:22 Xiao_kong 阅读(422) 评论(0) 推荐(0) 编辑
摘要: t = input()a = 0Left_bracket_Z=0Right_bracket_Z=0for i in t: if i== '(': a+=1 elif i== ')': if a>0: a-=1 else: print("配对不成功") break elif i=='[': Left_ 阅读全文
posted @ 2020-03-23 21:18 Xiao_kong 阅读(158) 评论(0) 推荐(0) 编辑
摘要: t = input()for i in t: if (ord('a') <= ord(i) <= ord('z')): t = chr(ord('a')+(ord(i)-ord('a')+3)%26) print(t,end='') elif (ord('A') <= ord(i) <= ord(' 阅读全文
posted @ 2020-03-23 21:12 Xiao_kong 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 阶乘是基斯顿·卡曼(Christian Kramp)于 1808 年发明的运算符号,是数学术语。一个正整数的阶乘(factorial)是所有小于及等于该数的正整数的积,并且0的阶乘为1。自然数n的阶乘写作n!。任何大于等于1 的自然数n 阶乘表示方法: n = int(input())sum = 1 阅读全文
posted @ 2020-03-23 19:09 Xiao_kong 阅读(744) 评论(0) 推荐(0) 编辑
摘要: a=input()print(a[::-1]) 阅读全文
posted @ 2020-03-23 19:08 Xiao_kong 阅读(152) 评论(0) 推荐(0) 编辑