![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python学习
AlwayswetHXZhang
老夫聊发少年狂
展开
-
寻找神秘4位数:在0-9十个数字中任意选择4个数字,如选2,9,8,4这四个数字,组成最大的数是9842,最小的数是2489,然后相减,再把得到的4位数组成的最大与最小值相减
寻找神秘4位数:在0-9十个数字中任意选择4个数字,如选2,9,8,4这四个数字,组成最大的数是9842,最小的数是2489,然后相减,再把得到的4位数组成的最大与最小值相减,在这样重复的过程中,你能找到一个神秘的四位数吗?# coding=UTF-8import random'''总体思路:全集:[0,1,2,3,4,5,6,7,8,9] 提取子集:[2,4,9,8](依次为例)第1轮:排序:[2,4,8,9]最值:9842、2489最值拆分:[9,8,4,2]差值:9842-原创 2020-10-15 11:14:55 · 13103 阅读 · 0 评论 -
Python:计算天干地支
Python:计算天干地支亲测有效!!!用Sublime编写,在CMD中运行正常tianGan_list=["甲","乙","丙","丁","戊","己","庚","辛","壬","癸"] #天干列表diZhi_list=["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"] #地支列表shengXiao_list=["鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"] #属相列表inputYear=in原创 2020-10-13 10:00:23 · 4291 阅读 · 3 评论