Skip to main content
🔒 Preview mode. The first 15 Foundations lessons are free; this one is Pro. Start a 7-day trial to unlock the editor, AI hints and the rest of the curriculum. Card required, cancel any time in Dashboard.Start 7-day trial →
← CoursesPython FoundationsModule 3 · Functions and stringsDouble the numberwrite33 / 174
+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`
✏️ Write your code here
🐍
Loading Python...
One-time download (~1 MB). Then it runs instantly.
📊 Result
Press Run to see result...

💬 Discussion

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