Created
September 16, 2023 00:50
-
-
Save weihanchen/f99fb44524263fb0b1fce5a98d27bded to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# |- <套件包名稱> | |
# |- core.py | |
from typing import List | |
def sum_array(arr: List[int]) -> int: | |
"""陣列總和器 | |
Args: | |
arr (List[int]): 整數陣列元素 | |
Returns: | |
總和 | |
""" | |
total = 0 | |
for num in arr: | |
total += num | |
return total |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment