Skip to content

Commit 5a021ae

Browse files
committed
def
1 parent c4ebca3 commit 5a021ae

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/def.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
def power(x, n=2):
2+
return x ** n
3+
4+
5+
# num1 = int(input("请输入第一个数:"))
6+
# num2 = int(input("请输入第二个数:"))
7+
# print(power(num1, num2))
8+
9+
10+
def calc(*numbers):
11+
sam = 0
12+
for item in numbers:
13+
sam = sam + item
14+
return sam
15+
16+
17+
print(calc(*[1, 2, 3, 4, 4, 5, 65, 6, 7, 87, 8, 9, 9]))

0 commit comments

Comments
 (0)