0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 3
click for more info
No active XP Potion
Accept a Quest
Login to submit answers
Sometimes when we're manually creating lists it can be hard to read if all the items are on the same line of code. We can declare the list using multiple lines if we want to:
flower_types = [
"daffodil",
"rose",
"chrysanthemum"
]
player_ages = [
23,
18,
31,
42
]
Writing it this way helps with readability and organization, especially if there are many items or if some of the items are too long. Keep in mind this is just a styling change. The code will run correctly either way.
When would you declare a list on multiple lines?