|
|
|
|
|
by integralid
285 days ago
|
|
Not if only one is the right one in all cases. In python you can also do s = set()
s.add(1)
s.add(2)
and s = set(x for x in [1, 2])
But I wouldn't call that having three ways to do the same.Disclaimer: I don't know java well, just commenting based on the comments above and my python knowledge. |
|