File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ The suggested order for going through each of the directories is:
78
78
* -` datatypes ` -- Experiment with type conversion
79
79
* -` modules ` -- Learn to import from modules
80
80
* -` printing ` -- Formatted print output
81
- * ` lists ` -- Python's version of arrays
81
+ * - ` lists ` -- Python's version of arrays
82
82
* ` tuples ` -- Immutable lists typically for heterogenous data
83
83
* ` slices ` -- Accessing parts of lists
84
84
* ` comprehensions ` -- List comprehensions
Original file line number Diff line number Diff line change @@ -35,10 +35,14 @@ def dist(a, b):
35
35
# Write a function `print_tuple` that prints all the values in a tuple
36
36
37
37
# YOUR CODE HERE
38
+ def print_tuple (t ):
39
+ for i in t :
40
+ print (i )
38
41
39
42
t = (1 , 2 , 5 , 7 , 99 )
40
43
print_tuple (t ) # Prints 1 2 5 7 99, one per line
41
44
42
45
# Declare a tuple of 1 element then print it
43
<
44E6
td data-grid-cell-id="diff-5e3839155c4697bae3f3b345e6d81cdcf0a1939007816c20883fc909d51cce97-43-45-2" data-line-anchor="diff-5e3839155c4697bae3f3b345e6d81cdcf0a1939007816c20883fc909d51cce97L43" data-selected="false" role="gridcell" style="background-color:var(--diffBlob-deletionLine-bgColor, var(--diffBlob-deletion-bgColor-line));padding-right:24px" tabindex="-1" valign="top" class="focusable-grid-cell diff-text-cell left-side-diff-cell border-right left-side">- u = (1 ) # What needs to be added to make this work?
46
+
47
+ u = (1 ,) # What needs to be added to make this work?
44
48
print_tuple (u )
You can’t perform that action at this time.
0 commit comments