Georgi Guninski
unread,Jun 15, 2023, 1:28:25 AM6/15/23Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sage-...@googlegroups.com
I am not python expert, but got hurt by passing dictionary as
optional argument.
Session:
In [1]: def f(n,a,ca={}):
...: for i in range(n):
...: ca[i+a]=i+a
...: print(i,"len(cac)",len(ca))
...:
In [2]: f(2,2)
0 len(cac) 1
1 len(cac) 2
In [3]: f(2,4)
0 len(cac) 3
1 len(cac) 4
What is the scientific way to avoid `0 len(cac) 3`?