You are viewing a single comment's thread. Return to all comments →
I used "if len(args>1):" just for practicing coding :D
I don't know about generator comprehension well.
But the reason why I used square brackets is because if I use parentheses, "discard 1 2 3" and "remove 5 7 9" does nothing to the set 's'.
I don't know why ONLY square brackets make that methods work.
Seems like cookies are disabled on this browser, please enable them to open this website
Set .discard(), .remove() & .pop()
You are viewing a single comment's thread. Return to all comments →
I used "if len(args>1):" just for practicing coding :D
I don't know about generator comprehension well.
But the reason why I used square brackets is because if I use parentheses, "discard 1 2 3" and "remove 5 7 9" does nothing to the set 's'.
I don't know why ONLY square brackets make that methods work.