AI Tutor

Your personal data science tutor
available 24/7

Powered by GPT-4o. Trained on your course content. Always patient, always available.

Datika AI Tutor

● Online — ready to help

I don't understand the difference between a list and a tuple in Python
Great question! Both store ordered collections, but the key difference is **mutability**.

A **list** can be changed after creation — you can add, remove, or update items:
```python
fruits = ["apple", "banana"]
fruits.append("mango")  # ✅ works
```

A **tuple** is **immutable** — once created, it cannot change:
```python
coords = (1.234, 36.817)  # Nairobi GPS
coords[0] = 0  # ❌ TypeError!
```

Use tuples when data should never change (like GPS coordinates or RGB colours). Use lists when you need to modify the collection. Does that help?
Yes! Can you give me a practice problem?
Sure! Here's one:

**Task**: You're tracking Nairobi matatu routes. Create a tuple for a fixed route (CBD → Westlands → Parklands) and a list for passengers that can board and alight. Write a function that adds a passenger and prints the updated list.

Try it yourself and paste your solution — I'll review it!

Everything a great tutor does

Just faster, cheaper, and always available.

Unlimited conversations

Ask anything, anytime. The AI Tutor never gets tired, never judges, and always explains in plain language.

Course-aware context

It knows exactly which lesson you're on and tailors every answer to your current learning stage.

Adaptive explanations

Struggling with a concept? It tries a different approach — analogy, code example, visual description — until it clicks.

AI assignment grading

Submit code or written answers and get instant, detailed feedback with suggestions for improvement.

Practice problem generator

Request more practice problems on any topic. The AI generates fresh, never-seen exercises at the right difficulty level.

Learning path guidance

Ask "what should I learn next?" and get a personalised roadmap based on your goals and progress.

Free plan: 10 messages/day  ·  Pro plan: unlimited

Start a conversation now

No signup needed to try the first 3 free messages.