Python中的一些小案例
壹念至贱
这个作者很懒,什么都没留下…
展开
-
身份证最后一位计算
jym = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2] # card:身份证号码前17位 card = "" list = list(card) cj = 0 for i in range(0, 17): cj = cj+jym[i] * int(list[i]) # qy:取余 余数为0-10之间 qy = cj % 11 var = [1, 0, "x", 9, 8, 7, 6, 5, 4, 3, 2] print(var[qy])原创 2021-04-11 10:39:42 · 486 阅读 · 0 评论 -
selenium检测GitHub项目
import time import requests from selenium import webdriver name = "psf/requests" api = "https://api.github.com/repos/"+name weburl = "https://github.com/"+name old_time = None while True: r = requests.get(api) if r.status_code != 200: p原创 2021-03-30 21:22:15 · 164 阅读 · 0 评论