本文整理汇总了Python中solution.is_number_balanced函数的典型用法代码示例。如果您正苦于以下问题:Python is_number_balanced函数的具体用法?Python is_number_balanced怎么用?Python is_number_balanced使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_number_balanced函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_is_number_balanced
def test_is_number_balanced(self):
self.assertEqual(True, solution.is_number_balanced(9))
self.assertEqual(True, solution.is_number_balanced(11))
self.assertEqual(False, solution.is_number_balanced(13))
self.assertEqual(True, solution.is_number_balanced(121))
self.assertEqual(True, solution.is_number_balanced(4518))
self.assertEqual(False, solution.is_number_balanced(28471))
self.assertEqual(True, solution.is_number_balanced(1238033))
示例2: test_is_number_balanced
def test_is_number_balanced(self):
self.assertEqual(is_number_balanced(9), True)
self.assertEqual(is_number_balanced(11), True)
self.assertEqual(is_number_balanced(13), False)
self.assertEqual(is_number_balanced(121), True)
self.assertEqual(is_number_balanced(4518), True)
self.assertEqual(is_number_balanced(28471), False)
self.assertEqual(is_number_balanced(1238033), True)
示例3: test_problem_statement_cases
def test_problem_statement_cases(self):
self.assertEqual(True, is_number_balanced(9))
self.assertEqual(True, is_number_balanced(11))
self.assertEqual(False, is_number_balanced(13))
self.assertEqual(True, is_number_balanced(121))
self.assertEqual(True, is_number_balanced(4518))
self.assertEqual(False, is_number_balanced(28471))
self.assertEqual(True, is_number_balanced(1238033))
示例4: test_is_balanced
def test_is_balanced(self):
self.assertEqual(True, solution.is_number_balanced(1238033))
self.assertEqual(True, solution.is_number_balanced(333))
self.assertEqual(False, solution.is_number_balanced(4344))
self.assertEqual(False, solution.is_number_balanced(1234))
self.assertEqual(True, solution.is_number_balanced(1))
self.assertEqual(True, solution.is_number_balanced(0))
示例5: test_is_number_balanced_1
def test_is_number_balanced_1(self):
self.assertEqual(True, is_number_balanced(5))
示例6: test_is_number_balanced_0
def test_is_number_balanced_0(self):
self.assertEqual(True, is_number_balanced(1238033))
示例7: test_is_number_balanced_2
def test_is_number_balanced_2(self):
self.assertEqual(False, is_number_balanced(13))
示例8: test_1238033
def test_1238033(self):
self.assertTrue(is_number_balanced(1238033))
示例9: test_11
def test_11(self):
self.assertTrue(is_number_balanced(11))
示例10: test_is_number_balanced3
def test_is_number_balanced3(self):
self.assertEqual(False, solution.is_number_balanced(4859))
示例11: test_with_single_digit_numbers
def test_with_single_digit_numbers(self):
self.assertTrue(solution.is_number_balanced(0))
self.assertTrue(solution.is_number_balanced(6))
示例12: test_balanced
def test_balanced(self):
self.assertTrue(is_number_balanced(9))
self.assertTrue(is_number_balanced(11))
self.assertTrue(is_number_balanced(121))
self.assertTrue(is_number_balanced(4518))
self.assertTrue(is_number_balanced(1238033))
示例13: test_1
def test_1(self):
self.assertEqual(True, solution.is_number_balanced(9))
示例14: test_6
def test_6(self):
self.assertEqual(False, solution.is_number_balanced(28471))
示例15: test_5
def test_5(self):
self.assertEqual(True, solution.is_number_balanced(4518))