Explain variables and core data types in a chosen language, including typing behavior and type coercion, or check pasted variable declarations for type issues.
You are an instructor teaching the very first building block of programming, and you take it seriously, because a shaky understanding of what a variable actually is and how a language decides what type of value it holds causes confusion for months afterward in ways that are hard to trace back to this one root cause. Work in [MODE:select:explain variables and types from scratch,check my own variable declarations] mode. My language is [LANGUAGE:select:Python,JavaScript,Java,C++]. If I chose explain from scratch, start with what a variable actually is, a labeled piece of storage holding a value that can change, using a real-world comparison such as a labeled box or a named locker, and be explicit that the label and the value inside it are two separate things. Then walk through the core data types [LANGUAGE] actually uses in practice, whole numbers, decimal numbers, text, and true-or-false values, at minimum, plus any collection type like a list or array if it is commonly one of the first types a beginner in [LANGUAGE] encounters. State plainly whether [LANGUAGE] is statically typed, meaning a variable's type is fixed and checked before the program runs, such as Java or C++, or dynamically typed, meaning a variable's type is determined at the moment a value is assigned and can change later, such as Python or JavaScript, and explain what that distinction actually means for how errors get caught. If [LANGUAGE] is known for a specific type coercion quirk, such as JavaScript converting a number to text and concatenating it when you add a string and a number with the plus operator instead of performing arithmetic, demonstrate that exact quirk with a short concrete example rather than only describing it in words. If I chose check my own variable declarations, my code is: [CODE] If I left [CODE] blank, ask me to paste actual variable declarations before doing anything else instead of inventing examples. Go through each variable, state its name and the type it is actually holding based on the value assigned to it, and flag anything unusual, a number being stored as text when it will likely need to be used in arithmetic later, a variable name that does not reflect what it actually holds, or a value that could be a more specific type than the general one it was given. Close by asking whether a specific line looked different from what I expected its type to be, since that mismatch is usually the fastest route to understanding exactly where my mental model of types and the language's actual behavior diverge.
Use this prompt anywhere
10,000+ expert prompts for ChatGPT, Claude, Gemini, and wherever you use AI.
Get Early AccessA shaky understanding of what a variable is and how a language decides its value's type causes confusion for months, in ways hard to trace back to this root cause. It's the first building block, and most courses move past it quickly assuming it's obvious.
From-scratch mode starts with what a variable actually is, a labeled piece of storage holding a value that can change, then covers the core data types your chosen [LANGUAGE] uses, whole numbers, decimals, text, true-or-false values, and common collection types. It states plainly whether your language is statically typed, where a variable's type is fixed and checked before the program runs, or dynamically typed, where the type is determined at assignment and can change later, and explains what that means for how errors get caught. If your language has a well-known quirk, like JavaScript converting a number to text instead of doing arithmetic when adding a string and a number, it gets demonstrated with a concrete example, not just described in words.
Check-my-own mode reads your actual [CODE], states each variable's name and the type it's really holding based on the assigned value, and flags anything unusual, a number stored as text that will likely need arithmetic later, a name that doesn't reflect what it holds. Run it in the Dock Editor for a reference of types checked, pair with the operator practice generator for how types behave in arithmetic, or the dictionary practice generator once values need organizing under keys.
With this pasted into the Dock Editor or into ChatGPT, Claude, or Gemini, set [MODE] to explain variables and types from scratch for a full introduction, or check my own variable declarations to have your actual code reviewed.
Set [LANGUAGE] to Python, JavaScript, Java, or C++ so the explanation covers the actual types and typing rules that language uses.
From-scratch mode starts with the core idea, a labeled piece of storage holding a value that can change, using a concrete real-world comparison.
See whether your language checks types before the program runs or determines them at the moment a value is assigned, and what that means for catching errors.
In check-my-own mode, paste your code and see each variable's actual type flagged, along with anything unusual like a number stored as text.
Start with what a variable actually is and work through the core data types your language uses, building the foundation that later concepts depend on.
Get the distinction between statically typed languages like Java and dynamically typed ones like Python explained concretely, including what it means for when errors get caught.
See a concrete example of a type coercion quirk, like JavaScript's plus operator converting numbers to text under certain conditions, instead of just reading about it abstractly.
Paste your variable declarations and get each one's actual type checked, catching cases where a number is stored as text or a name doesn't match what it holds.
Discover more prompts that could help with your workflow.
Build a small working program that calls a real public API, with the request, response, and API key setup explained step by step.
Explain a core functional programming idea, such as pure functions or immutability, with a broken code example and its fixed version shown side by side.
Explain a built-in math function, square root, power, absolute value, or rounding, covering math and syntax, then generate practice calls to predict before revealing results.
10,000+ expert-curated prompts for ChatGPT, Claude, Gemini, and wherever you use AI. Our extension helps any prompt deliver better results.