当前位置: 首页>>代码示例>>Python>>正文


Python sum_of_multiples.sum_of_multiples函数代码示例

本文整理汇总了Python中sum_of_multiples.sum_of_multiples函数的典型用法代码示例。如果您正苦于以下问题:Python sum_of_multiples函数的具体用法?Python sum_of_multiples怎么用?Python sum_of_multiples使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了sum_of_multiples函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_multiples_of_5_6_or_8_up_to_150

 def test_multiples_of_5_6_or_8_up_to_150(self):
     self.assertEqual(sum_of_multiples(150, [5, 6, 8]), 4419)
开发者ID:Oniwa,项目名称:exercism.io,代码行数:2,代码来源:sum_of_multiples_test.py

示例2: test_configurable_4_6_to_15

 def test_configurable_4_6_to_15(self):
     self.assertEqual(30, sum_of_multiples(15, [4, 6]))
开发者ID:a62mds,项目名称:exercism,代码行数:2,代码来源:sum_of_multiples_test.py

示例3: test_configurable_43_47_to_10000

 def test_configurable_43_47_to_10000(self):
     self.assertEqual(2203160, sum_of_multiples(10000, [43, 47]))
开发者ID:a62mds,项目名称:exercism,代码行数:2,代码来源:sum_of_multiples_test.py

示例4: test_sum_to_1

 def test_sum_to_1(self):
     self.assertEqual(0, sum_of_multiples(1, [3, 5]))
开发者ID:a62mds,项目名称:exercism,代码行数:2,代码来源:sum_of_multiples_test.py

示例5: test_sum_to_1000

 def test_sum_to_1000(self):
     self.assertEqual(233168, sum_of_multiples(1000, [3, 5]))
开发者ID:a62mds,项目名称:exercism,代码行数:2,代码来源:sum_of_multiples_test.py

示例6: test_multiples_of_zero_will_be_none

 def test_multiples_of_zero_will_be_none(self):
     self.assertEqual(sum_of_multiples(1, [0]), 0)
开发者ID:rootulp,项目名称:exercism,代码行数:2,代码来源:sum_of_multiples_test.py

示例7: test_multiples_of_several_factors

 def test_multiples_of_several_factors(self):
     self.assertEqual(sum_of_multiples(10000,
                                       [2, 3, 5, 7, 11]), 39614537)
开发者ID:rootulp,项目名称:exercism,代码行数:3,代码来源:sum_of_multiples_test.py

示例8: test_various_multiples_in_limit

 def test_various_multiples_in_limit(self):
     self.assertEqual(sum_of_multiples(7, [3]), 9)
开发者ID:rootulp,项目名称:exercism,代码行数:2,代码来源:sum_of_multiples_test.py

示例9: test_various_factors_with_multiples_in_limit

 def test_various_factors_with_multiples_in_limit(self):
     self.assertEqual(sum_of_multiples(10, [3, 5]), 23)
开发者ID:rootulp,项目名称:exercism,代码行数:2,代码来源:sum_of_multiples_test.py

示例10: test_multiples_with_no_factors_in_limit

 def test_multiples_with_no_factors_in_limit(self):
     self.assertEqual(sum_of_multiples(1, [3, 5]), 0)
开发者ID:rootulp,项目名称:exercism,代码行数:2,代码来源:sum_of_multiples_test.py

示例11: test_multiples_of_one_factor_within_limit

 def test_multiples_of_one_factor_within_limit(self):
     self.assertEqual(sum_of_multiples(4, [3, 5]), 3)
开发者ID:rootulp,项目名称:exercism,代码行数:2,代码来源:sum_of_multiples_test.py

示例12: test_multiples_of_1_up_to_100

 def test_multiples_of_1_up_to_100(self):
     self.assertEqual(sum_of_multiples(100, [1]), 4950)
开发者ID:Oniwa,项目名称:exercism.io,代码行数:2,代码来源:sum_of_multiples_test.py

示例13: test_multiples_of_43_or_47_up_to_10000

 def test_multiples_of_43_or_47_up_to_10000(self):
     self.assertEqual(sum_of_multiples(10000, [43, 47]), 2203160)
开发者ID:Oniwa,项目名称:exercism.io,代码行数:2,代码来源:sum_of_multiples_test.py

示例14: test_multiples_of_5_or_25_up_to_51

 def test_multiples_of_5_or_25_up_to_51(self):
     self.assertEqual(sum_of_multiples(51, [5, 25]), 275)
开发者ID:Oniwa,项目名称:exercism.io,代码行数:2,代码来源:sum_of_multiples_test.py

示例15: test_multiples_of_one_will_be_all

 def test_multiples_of_one_will_be_all(self):
     self.assertEqual(sum_of_multiples(100, [1]), 4950)
开发者ID:rootulp,项目名称:exercism,代码行数:2,代码来源:sum_of_multiples_test.py


注:本文中的sum_of_multiples.sum_of_multiples函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。