本文整理汇总了Python中solution.Solution.multiply方法的典型用法代码示例。如果您正苦于以下问题:Python Solution.multiply方法的具体用法?Python Solution.multiply怎么用?Python Solution.multiply使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类solution.Solution
的用法示例。
在下文中一共展示了Solution.multiply方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_1
# 需要导入模块: from solution import Solution [as 别名]
# 或者: from solution.Solution import multiply [as 别名]
def test_1():
sol = Solution()
for _ in xrange(100):
n1 = np.random.randint(100000)
n2 = np.random.randint(100000)
n = n1 * n2
assert sol.multiply(str(n1), str(n2)) == str(n)
示例2: test_2
# 需要导入模块: from solution import Solution [as 别名]
# 或者: from solution.Solution import multiply [as 别名]
def test_2():
sol = Solution()
n1 = "34951988787875060539794079748961576784564363070245114613707595672441019547866090721102583434"
n2 = "16659770238224335056461144790912689758874618241978614940512513991166165549575662545139401664"
key = "5822921025749915852214668758391140049878435518175951031971353065579437743518919000057828559" \
"00775852608271536564205447032568312955070157163090097380822461926168774347387939575398434176"
assert sol.multiply(n1, n2) == key
示例3: test1
# 需要导入模块: from solution import Solution [as 别名]
# 或者: from solution.Solution import multiply [as 别名]
def test1(self):
s = Solution()
num1 = '11'
num2 = "12"
res = s.multiply(num1, num2)
print res
示例4: test3
# 需要导入模块: from solution import Solution [as 别名]
# 或者: from solution.Solution import multiply [as 别名]
def test3(self):
s = Solution()
num1 = '0'
num2 = "15"
res = s.multiply(num1, num2)
print res
示例5: test_0
# 需要导入模块: from solution import Solution [as 别名]
# 或者: from solution.Solution import multiply [as 别名]
def test_0():
sol = Solution()
assert sol.multiply('0', '123') == '0'
assert sol.multiply('123', '0') == '0'
assert sol.multiply('0', '0') == '0'