0
0
Pythonprogramming~10 mins

List creation and representation in Python - Mini Project: Build & Apply

Choose your learning style9 modes available
List creation and representation
๐Ÿ“– Scenario: You are organizing a small party and want to keep track of the guests who will attend.
๐ŸŽฏ Goal: Create a list of guest names, add a new guest, and then display the full guest list.
๐Ÿ“‹ What You'll Learn
Create a list with exact guest names
Add a new guest name to the list
Print the full list of guests
๐Ÿ’ก Why This Matters
๐ŸŒ Real World
Lists are used to keep track of groups of items, like guests, tasks, or products.
๐Ÿ’ผ Career
Knowing how to create and manage lists is essential for organizing data in many programming jobs.
Progress0 / 4 steps
1
Create the initial guest list
Create a list called guests with these exact names: 'Alice', 'Bob', and 'Charlie'.
Python
Need a hint?

Use square brackets [] to create a list and separate names with commas.

2
Add a new guest to the list
Add the guest name 'Diana' to the existing guests list using the append() method.
Python
Need a hint?

Use guests.append('Diana') to add the new guest.

3
Prepare to display the guest list
Create a variable called guest_list_str that joins all names in guests into a single string separated by commas and spaces.
Python
Need a hint?

Use ', '.join(guests) to combine list items into a string.

4
Display the full guest list
Print the string guest_list_str to show all guest names separated by commas.
Python
Need a hint?

Use print(guest_list_str) to display the names.