thecodezone.
The Code Zone
Short steps, at your pace · Free lessons and practice · Member video walkthroughs
Save your next small win.

Checking your account…

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

All courses

Python 3: Lists / 01.03

Practice list creation

Not started

Keep two original fruit lists and build a third combined list.

More options

Your lesson progress

Walkthrough: not startedPractice: not started

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.

Rob combines apple and banana with cherry in a new tray while keeping both original trays.
Rob’s comic strip · Create and access lists

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.

Expected output
['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.

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.

Replace your editor code?

Your current work will be replaced. Choose Cancel to keep it.

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

ONE STEP FORWARD

The combined result has its own list value, and len counts the three fruit items.