标签:sum python elf 要求 self def app HERE 思路
写一个函数,求两个整数之和,要求在函数体内不得使用+、-、*、/四则运算符号。
思路:可以使用sum(),它可以对一个数组内部所有元素求和
# -*- coding:utf-8 -*-
class Solution:
def Add(self, num1, num2):
# write code here
a=[]
a.append(num1)
a.append(num2)
b=sum(a)
return b
标签:sum python elf 要求 self def app HERE 思路
原文地址:https://www.cnblogs.com/cong3Z/p/12922633.html