鱼C论坛

 找回密码
 立即注册
查看: 7642|回复: 105

[已解决]Python:每日一题 354

[复制链接]
发表于 2020-8-10 14:03:58 | 显示全部楼层
  1. def fun354(left,right):
  2.    
  3.     def self_counting(x):
  4.         if '0' in str(x):
  5.             return False
  6.         list_counting = [x%int(i) for i in str(x)]
  7.         if len(set(list_counting)) != 1:
  8.             return False
  9.         return True

  10.     result = [i for i in range(left,right+1) if self_counting(i)]
  11.     return result
复制代码
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-10-28 04:35

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表