Learn something new every day

Here's one thing to learn today based on a topic you pick

What you will receive

Today's learning: Python

just now

Did you know?

Python's "walrus operator" (:=) lets you assign and use a value in one expression.

Example:
if (n := len(data)) > 10:
    print(f"Too much data: {n} items")

Try it: Refactor one of your if statements to use :=

Source: PEP 572

How it works

  1. 1You pick a topic you want to learn about
  2. 2AI finds an interesting, bite-sized concept
  3. 3You get one actionable learning each day

You configure

Python, JavaScript, machine learning, etc.

What do you want to learn about?

intermediate

beginner, intermediate, or advanced

sk-...

For generating learning content

View Python code
import requests
import os
from state import state
import random

TOPIC = os.environ.get("LEARNING_TOPIC", "programming")
LEVEL = os.environ.get("SKILL_LEVEL", "intermediate")
OPENAI_API_KEY = os.environ.get("OPENAI_API_KEY")

# Track what we've taught to avoid repetition
taught = state.get("taught_concepts", [])

prompt = f"""Teach me ONE interesting {LEVEL}-level concept about {TOPIC}.

Previously taught (avoid these): {', '.join(taught[-10:]) if taught else 'None yet'}

Format:
- Concept name: [name]
- Explanation: [2-3 sentences]
- Example: [code or practical example]
- Try it: [one small exercise]

Keep it concise and actionable. Under 100 words total."""

response = requests.post(
    "https://api.openai.com/v1/chat/completions",
    headers={"Authorization": f"Bearer {OPENAI_API_KEY}"},
    json={
        "model": "gpt-4o-mini",
        "messages": [{"role": "user", "content": prompt}],
        "max_tokens": 200
    }
)

lesson = response.json()["choices"][0]["message"]["content"]

# Extract concept name and track it
lines = lesson.split("\n")
concept = lines[0].replace("Concept name:", "").replace("-", "").strip() if lines else TOPIC
taught.append(concept)
state["taught_concepts"] = taught[-20:]  # Keep last 20

print(lesson)

Humrun remembers what concepts it taught you to avoid repetition.

Suggested schedule: Every weekday at 9 AMNotifications: After every run
Browse more templates