Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # エキスパートpythonプログラミング 4.4.3 からの引用
- def sum(*args):
- total = 0
- for arg in args:
- total += arg
- return total
- # *args を避けた例
- def sum(sequence):
- total = 0
- for arg in sequence:
- total += arg
- return total
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement