ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 17 Oct 2018 00:33:16 -0500Is there any difference between the variables b and *b in these two statements? If so, what is it?http://ask.sagemath.org/question/43966/is-there-any-difference-between-the-variables-b-and-b-in-these-two-statements-if-so-what-is-it/
(a, b, c) = 1, 2, 3
(a, *b, c) = 1, 2, 3Tue, 16 Oct 2018 08:54:43 -0500http://ask.sagemath.org/question/43966/is-there-any-difference-between-the-variables-b-and-b-in-these-two-statements-if-so-what-is-it/Answer by nbruin for <pre><code> (a, b, c) = 1, 2, 3
(a, *b, c) = 1, 2, 3
</code></pre>
http://ask.sagemath.org/question/43966/is-there-any-difference-between-the-variables-b-and-b-in-these-two-statements-if-so-what-is-it/?answer=43969#post-id-43969The second is a syntax error in Python 2. In Python 3, the second one is valid. To see the difference, print b after both cases and compare. Hint: (a, *b, c) = (1,2,3,4) does not give an error.
This is really a python question. It has very little to do with sage specifically (especially because it doesn't quite run flawlessly on python 3 yet).Wed, 17 Oct 2018 00:33:16 -0500http://ask.sagemath.org/question/43966/is-there-any-difference-between-the-variables-b-and-b-in-these-two-statements-if-so-what-is-it/?answer=43969#post-id-43969