We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b498a76 commit 4cb09faCopy full SHA for 4cb09fa
ch09-lists-tuples-and-dictionaries/2-lists-are-mutable-sequences.py
@@ -38,3 +38,11 @@
38
# Exercise 7
39
# Verify that breakfast has three items using len()
40
print(len(breakfast) == 3)
41
+
42
43
+# Exercise 8
44
+# Create a new list called `lengths` using a list
45
+# comprehension that contains the lengths of each
46
+# string in the `breakfast` list.
47
+lengths = [len(item) for item in breakfast]
48
+print(lengths)
0 commit comments