"Lie Ryan" <lie.1...@gmail.com> wrote
and used print, I thought they would be considered the same whether as a variable, or as a direct line, guess not.
what is equivalent:
print (a, b, c)

and
x = a, b, c
print x

both construct a tuple and prints a,b,c as tuple

Not quite:

a = 1
b = 2
c = 3
x = a,b,c
print a,b,c
1 2 3
print x
(1, 2, 3)


The first form prints multiple values the second prints the repr of a single tuple value. The output is different.

Alan G.


_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to