1 import threading 2 import time 3 def coding(): 4 for i in range(3): 5 print('输入代码%s' %i) 6 time.sleep(1) 7 def drawing(): 8 for i in range(3): 9 pri ...
分类:
编程语言 时间:
2020-06-07 13:13:27
阅读次数:
68
nums = [] lst = [i for i in range(101)] l = [] for j in range(2,101): # 将质数加入到 l 中 temp = 1 for i in range(2,j-1): if lst[j] % i == 0: temp = 0 if tem ...
分类:
其他好文 时间:
2020-06-07 12:41:13
阅读次数:
61
之前在用chr将一个编码转化为对应的字符时,出现以下提示 chr() arg not in range(256) 后来发现,只有python2.x才会出现这种情况,python3.x统一使用unicode可以直接用chr,所以要修改pycharm自带控制台的版本 把interpreter设置为pyt ...
分类:
编程语言 时间:
2020-06-07 12:37:19
阅读次数:
103
jQuery Mobile 滑动条控件 滑动条允许您从一个范围的数字中选择一个值: 如需创建滑动条,请使用 <input type="range">: 实例 <form method="post" action="demoform.php"> <label for="points">进度:</lab ...
分类:
Web程序 时间:
2020-06-07 10:49:11
阅读次数:
80
from functools import reduce i = int(input("input a number 1-10: ")) result = reduce(lambda a, b: a*b, [item for item in range(1,i+1)]) print(f'factor ...
分类:
编程语言 时间:
2020-06-06 21:41:28
阅读次数:
86
基础操作 import sqlalchemy import threading import datetime from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import create_engine f ...
分类:
数据库 时间:
2020-06-06 20:08:55
阅读次数:
84
random模块 随机小数 random.random() # 大于0且小于1之间的小数 0.7664338663654585 random.uniform(1,3) #大于1小于3的小数 1.6270147180533838 随机整数 random.randint(1,5) # 大于等于1且小于等 ...
分类:
其他好文 时间:
2020-06-06 18:56:52
阅读次数:
56
for m in range(1,22): for n in range(1,22): for p in range(1,22): for q in range(1,22): if (7-m)*(7-n)*(7-p)*(7-q)==4 and len(set([m,n,p,q]))==4: prin ...
分类:
编程语言 时间:
2020-06-06 17:04:31
阅读次数:
158
问题描述 给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那 两个 整数,并返回他们的数组下标。 你可以假设每种输入只会对应一个答案。但是,数组中同一个元素不能使用两遍。 示例: 给定 nums = [2, 7, 11, 15], target = 9 因为 n ...
分类:
其他好文 时间:
2020-06-06 16:58:28
阅读次数:
51
找规律 思路: 由题意可知,由于只能向下或向右移动,所以总共只需要走(m-1)+(n-1)= m+n-2步。而只需要确定m-1步向右的步数或者确定向下的n-1步,即可确定路径,所以共有或者种可能。 代码: class Solution: def uniquePaths(self, m: int, n ...
分类:
其他好文 时间:
2020-06-06 15:37:59
阅读次数:
68