Skip to main content
← CoursesAI Engineering with PythonModule 1 · LLM API FundamentalsMulti-turn conversationspredict5 / 101
💬 Discuss🧪 Playground+75 XP
Task
📝 **Predict** the output: ```python history = [] history.append({"role": "user", "content": "A"}) history.append({"role": "assistant", "content": "B"}) history.append({"role": "user", "content": "C"}) print(len(history)) ```

Keep going

🔮 Predict the output

Read the code carefully

history = []
history.append({"role": "user", "content": "A"})
history.append({"role": "assistant", "content": "B"})
history.append({"role": "user", "content": "C"})
print(len(history))

What will the program print? Write here:

📣 Help someone learn PythonShare this lesson with a friend — the first 15 are free, no signup.Tweet

💬 Discussion

Be the first to ask a question or share a tip.
Sign in to join the discussion. Reading is free.
Loading discussion…