Post

Benjamin Bennett Alexander
Benjamin Bennett Alexander@RealBenjizo·
Python Question: Be careful; this one is tricky. 😅 What is the output of this code and why?
Benjamin Bennett Alexander tweet media
English
17
6
60
8.1K
Coding Computing Coach
Coding Computing Coach@CodingComputing·
@RealBenjizo Answer: a. tuple Solution: In Python, a comma makes a tuple. The parentheses are actually the optional part. So, what many people assume is "python magic" like a, b = b, a is actually just a tuple assignment. The comma between the list [1, 2] and the tuple (1,2) makes a tuple
English
0
1
1
110
Paylaş