My question is rather simple : is there a more pythonic way of doing this?
def f(array, start=0, end=None):
if not end:
end = len(array)
(...)
Because using f(array, start=0, end=len(array)
won't work.
Not really. One nitpick:
def f(array, start=0, end=None):
if end is None:
end = len(array)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.