上一页 1 ··· 3 4 5 6 7 8 9 10 11 下一页
摘要: 点击查看代码 import requests # url='https://www.kfc.com.cn/kfccda/storelist/index.aspx' url = 'https://www.kfc.com.cn/kfccda/ashx/GetStoreList.ashx?op=keywo 阅读全文
posted @ 2024-10-03 21:20 神仙不在 阅读(7) 评论(0) 推荐(0)
摘要: 点击查看代码 import requests # url='https://movie.douban.com/typerank?type_name=%E7%88%B1%E6%83%85&type=13&interval_id=100:90&action=' url = 'https://movie. 阅读全文
posted @ 2024-10-03 20:46 神仙不在 阅读(4) 评论(0) 推荐(0)
摘要: 点击查看代码 # https://sc.chinaz.com/jianli/xiaochengchu.html import requests from lxml import etree url = 'https://sc.chinaz.com/jianli/xiaochengchu.html' 阅读全文
posted @ 2024-10-03 16:36 神仙不在 阅读(5) 评论(0) 推荐(0)
摘要: 点击查看代码 import os dirname = 'meinv/666' if not os.path.exists(dirname): os.makedirs(dirname) 阅读全文
posted @ 2024-10-03 09:20 神仙不在 阅读(18) 评论(0) 推荐(0)
摘要: 有一个列表[11, 15, 2, 7],有一个目标值为9,求列表里的哪2个数字和是9,打印出他们的下标 点击查看代码 list = [11, 15, 2, 7] target = 9 for i in range(len(list)): for j in range(i + 1, len(list) 阅读全文
posted @ 2024-10-02 08:10 神仙不在 阅读(2) 评论(0) 推荐(0)
摘要: 点击查看代码 # 判断一个整数是否为回文数 num = input('输入一个整数:') dao_num = num[::-1] if dao_num == num: print(f'{num}是回文数') else: print(f'{num}不是回文数') 阅读全文
posted @ 2024-09-29 20:42 神仙不在 阅读(8) 评论(0) 推荐(0)
摘要: 点击查看代码 # 求解 100~999 之间的所有水仙花数 gewei = 0 shiwei = 0 baiwei = 0 for i in range(100, 1000): i = str(i) gewei = int(i[0]) shiwei = int(i[1]) baiwei = int( 阅读全文
posted @ 2024-09-29 16:12 神仙不在 阅读(8) 评论(0) 推荐(0)
摘要: 点击查看代码 for j in range(2, 11): flag = True for i in range(2, j): if j % i == 0: flag = False print(f'{j}是合数,{j}={i}x{j // i}') break if flag: print(f'{ 阅读全文
posted @ 2024-09-28 23:11 神仙不在 阅读(9) 评论(0) 推荐(0)
摘要: 老铁们用 for循环和while循环试试 `` 点击查看代码 for i in range(1, 10): for j in range(9, i - 1, -1): print(f'{j}x{i}={j * i}', end="\t") print() 点击查看代码 i = 1 while i < 阅读全文
posted @ 2024-09-28 12:17 神仙不在 阅读(7) 评论(0) 推荐(0)
摘要: 抛硬币,打印每次的正反面结果,最终统计正反面次数 点击查看代码 import random num = int(input('输入抛硬币的次数')) 正面次数 = 0 反面次数 = 0 for i in range(1, num + 1): random_num = random.randint(1 阅读全文
posted @ 2024-09-27 12:50 神仙不在 阅读(28) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 11 下一页
点击右上角即可分享
微信分享提示