01.03 · Create and access lists / Practice · 7 min
Combine two lists and count the result
Two source trays should stay intact when you create the combined tray.
Activity 3 of 5 in Create and access lists
Python 3: Lists / 01.03
Practice list creation
Not started
Keep two original fruit lists and build a third combined list.
Your lesson progress
Empty: not started. Yellow: in progress. Green: complete. Marking the whole activity complete does not replace your test results. These circles save in this browser for this pilot.

Your task
Keep first_fruits as ["apple", "banana"] and second_fruits as ["cherry"]. Assign their combined list to all_fruits, and assign its item count to fruit_count.
Print all_fruits, then fruit_count, each once. The expected lines are ['apple', 'banana', 'cherry'] and 3. Leave the two source lists unchanged.
What the checks verify
Checks compare output and the stored values for these inputs. They do not prove which operator you typed or every possible input. After passing, add another fruit to second_fruits: the count should become 4. Restore the original inputs before checking again.
Build it one step at a time
Prefer learning by typing? Work through short instructions, run the Python code and check each change before continuing. Your guided project saves separately from the challenge below.
The mini-lesson opens in a new tab. Your own code carries forward; each step has a focused check and an optional hint.
Start mini-lesson(opens in a new tab)4 steps · Saved work · Instant feedback
YOUR TURN
Combine fruit lists
Create all_fruits from the two source lists and fruit_count from its length. Print the combined list, then its count. Preserve both source lists.
['apple', 'banana', 'cherry'] 3
Keep the starting inputs. Print these lines in this order, without extra output.
- Store a three-item count
- Preserve the first list
- Preserve the second list
- Store all fruits in order
Edit Python, then run it. Check challenge checks your output and the listed Python requirements. Your code saves on this browser after a short pause. Sign in and choose Save account draft to keep it across devices. Word wrap is enabled.
Ready to checkRun the checks to see your results here.
Your check results
Need a nudge?
Make a new list
Use the two existing list names on either side of +. Store that expression in all_fruits.
Count the combined items
Call len with all_fruits, rather than writing the count by hand.
One possible solution
Your code may look different and still be correct. Compare the approach with your own.
Concatenation builds a new list. Its length follows the data, so it stays useful when you add another fruit.
Walk through the fix.
Choose Next to inspect one change at a time. Highlighted lines show what to notice. Your editor stays unchanged unless you choose to load a step.
Step 1 of 2
Read the inputs
Create all_fruits from the two source lists and fruit_count from its length. Print the combined list, then its count. Preserve both source lists.
first_fruits = ["apple", "banana"]
second_fruits = ["cherry"]Expected output for this step
(No output)
Build the requested result
Concatenation builds a new list. Its length follows the data, so it stays useful when you add another fruit.
first_fruits = ["apple", "banana"]
second_fruits = ["cherry"]
all_fruits = first_fruits + second_fruits
fruit_count = len(all_fruits)
print(all_fruits)
print(fruit_count)Expected output for this step
['apple', 'banana', 'cherry'] 3
See the complete solution
first_fruits = ["apple", "banana"]
second_fruits = ["cherry"]
all_fruits = first_fruits + second_fruits
fruit_count = len(all_fruits)
print(all_fruits)
print(fruit_count)Ready to try it?
Practice in your browser and see your results.
Progress details
Have a question?
Ask the Code Zone community.
Ask a question in The Code Zone (opens in a new tab)Continue learning

7 days freeTry The Code Zone
THE CODE ZONE COMMUNITY
Your next step is easier together.
Try the community free for 7 days.
No charge during your trial. Choose your plan on Skool.
- Ask questions and get support in the community
- Watch every course video walkthrough
- Find a study buddy in the 24/7 study room
Make the most of your trial with Premium.
Choose Premium on Skool to try Thursday live help sessions. Bring your questions, work through code, and get unstuck together.
Scheduled Thursdays in Eastern Time. Check the Skool calendar for your local date and time.
Have a website account? Sign in