List creation (listOf, mutableListOf)
📖 Scenario: You are organizing a small party and need to keep track of the guests who will attend.
🎯 Goal: Create a list of guests using listOf and then create a mutable list using mutableListOf to add more guests later.
📋 What You'll Learn
Create an immutable list called
guests with exactly these names: "Alice", "Bob", "Charlie"Create a mutable list called
moreGuests starting with the same names as guestsAdd the name
"Diana" to the moreGuests listPrint the
moreGuests list to show all guests💡 Why This Matters
🌍 Real World
Lists are used everywhere to keep track of groups of items, like guests at a party, tasks to do, or products in a store.
💼 Career
Knowing how to create and modify lists is a basic skill for any programmer, useful in almost all software development jobs.
Progress0 / 4 steps