![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
>付先生
这个作者很懒,什么都没留下…
展开
-
python>进制转换(十进制二进制互转)
#十进制正整数转化为二进制算法 #encoding=utf-8 import operator n = int(input(“please input the number to convert to binary number:”)) a = 1 list = [] while a>0: a,b = divmod(n,2) print(a,b) list.append(str(b)) n ...原创 2019-06-25 15:07:23 · 3435 阅读 · 0 评论 -
pyhton>冒泡排序,快排
冒泡排序 a = [9,4,7,2,3,6,1] for i in range(len(a)): for j in range(len(a)-i-1): if a[j] > a[j+1]: a[j],a[j+1] = a[j+1],a[j] 快排 a = [9,4,7,2,3,6,1] for i in range(len(a)): ...原创 2019-06-25 15:30:02 · 79 阅读 · 0 评论 -
python>Fibonacci数列
递归: def fibo(n): if n <= 1: return n else: return (fibo(n-1)+fibo(n-2)) number = int(input("输出几位斐波那契数列?")) if number <= 0: print("输入正数") else: print("斐波那契数列:") for i in rang...原创 2019-06-25 15:50:53 · 756 阅读 · 0 评论 -
selenium>163邮箱自动发邮件
#encoding=utf-8 import unittest import time from selenium import webdriver class Send163Email(unittest.TestCase): def setUp(self): # 启动IE浏览器# self.driver = webdriver.Chrome(executable_...原创 2019-08-22 16:01:30 · 333 阅读 · 0 评论