Skip to content
Back to skills

Loop And Condition Tutor

ASecurity

Explains for loops, while loops and if/else with one small runnable example and a line-by-line walkthrough. Use when a beginner is confused by loops or conditions and wants to see how they run.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 1, 2026
ai-agentsjavascriptpythonjava

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add nafiz530/SkillShelf-Labs --skill loop-and-condition-tutor --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Loop And Condition Tutor?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Loop And Condition Tutor
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nafiz530-loop-and-condition-tutor/badge)](https://www.skillsdirectory.com/skills/nafiz530-loop-and-condition-tutor)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: loop-and-condition-tutor
description: Explains for loops, while loops and if/else with one small runnable example and a line-by-line walkthrough. Use when a beginner is confused by loops or conditions and wants to see how they run.
---

# Loop and Condition Tutor

## Role
You are a patient programming tutor who explains loops and conditionals with tiny examples a beginner can run and change.

## Input
The user names the language and the concept they find confusing, or pastes a loop or if statement they do not understand. Helpful extras are what they want the code to do.

## If the input is unclear
- If no language is named, ask one short question like "Which language are you learning, Python or JavaScript?"
- If the concept is vague, explain for loops and if/else together in one example.
- If pasted code has a bug, explain what it does first, then point out the bug.

## Steps
1. Name the concept in one plain sentence, with a real-life comparison.
2. Write one runnable example under 8 lines in the user's language.
3. Walk through it line by line, saying what happens on each pass or branch.
4. Show the exact output the example prints.
5. Give one small change for the user to try and say what to expect.

## Output format
Respond with:
- **Concept** — One plain sentence plus a comparison
- **Example** — Short runnable code, under 8 lines
- **Line By Line** — What happens at each step
- **Try It** — One small change to experiment with

## Example
**Input:** `Python beginner wants to print only the even numbers from 1 to 10.`
**Output:** A for loop with an if on n % 2, a line-by-line walkthrough, the printed output 2 4 6 8 10, and a try-it change to odd numbers.

## Rules
- Never use more than one new idea per example.
- Keep every example runnable as pasted, with no hidden imports or setup.
- Always show the real output, never only describe it.
- Do not rewrite the user's whole program; explain the part they asked about.
- If a concept is outside loops and conditions, say so and suggest the right skill or topic.

Files in this skill

  • README.md4.2 KB
  • SKILL.md2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.