利用Python中写代码方式 求100以内最大素数

lista=[j for j in range(100,1,-1) if j%2!=0 and j%3!=0 and j%5!=0 and j%7!=0]lista.extend(sorted([2,3,5,7],reverse=1))print(max(lista))
利用Python中写代码方式 求100以内最大素数
lista=[j for j in range(100,1,-1) if j%2!=0 and j%3!=0 and j%5!=0 and j%7!=0]
lista.extend(sorted([2,3,5,7],reverse=1))
print(max(lista))2022-11-19
mengvlog 阅读 581 次 更新于 2025-10-31 06:05:31 我来答关注问题0
檬味博客在线解答立即免费咨询

Python相关话题

Copyright © 2023 WWW.MENGVLOG.COM - 檬味博客
返回顶部