Skip to main content
← CoursesPython FoundationsModule 3 · Functions and stringsDouble the numberwrite31 / 170
💬 Discuss🧪 Playground+75 XP
Task
📝 **Task:** Write a function `double(n)` that takes a number and returns it multiplied by 2. 📋 **Steps:** 1. Define `def double(n):` 2. Return `n * 2` 3. Call `double(7)` and `print` the result 💡 **Similar example (different values):** ```python def triple(x): return x * 3 print(triple(4)) # 12 ``` ⚠️ **Hint:** `return` hands the value back, `print` only displays it. 🎯 **Expected output:** `14`

Keep going

✏️ Write your code here
🐍
Loading Python...
First visit only — ~5-10s. Stays cached afterward.
📊 Result
Press Run to see result...
📣 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…