Python The 8 Basic Types & Dynamic Typing
Lua is dynamically typed with exactly 8 fundamental types: `nil`, `boolean`, `number`, `string`, `table`, `function`, `thread`, and `userdata`. The `type()` function inspects values at runtime.
Deep Dive: How It Works
nil: Represents the absence of a useful value. Unassigned variables evaluate to `nil`.
boolean: Has values `true` and `false`.
number: Represents double-precision floats and 64-bit integers (Lua 5.3+).
string: Immutable byte sequence.
table: The only data structuring mechanism (arrays, hashes, objects).
function: First-class values in Lua.
thread: Coroutines for cooperative multitasking.
userdata: C data stored in Lua memory.
Core Rules to Remember


Live Interactive Example
Hit Run Code to see it liveYour Turn: Micro Challenge
No pressure! Edit the starter code below and test your solution with instant feedback.
Verify Variable Types
Declare `local score = 99.5`.
Print `"Score type: " .. type(score)`.
Finished reading and practicing?
Mark this lesson as completed to update your course progress.