Python Strings, Characters & Interpolation
In Julia, single quotes denote a single Unicode Char while double quotes denote a String. Perform interpolation using $var or $(expression) and concatenation using *.
Deep Dive: How It Works
Characters vs Strings: 'a' is of type Char (a 32-bit Unicode code point). "a" is a String (an immutable UTF-8 encoded array of characters).
String Concatenation: Uses the multiplication operator * rather than + (representing algebraic non-commutative string monoid concatenation). string(a, b) is also available.
Interpolation: $variable inserts a variable, and $(expr) evaluates arbitrary Julia code inline.
Core Rules to Remember



Common Beginner Traps & How to Fix Them
Using + for string concatenation (e.g. "Hello " + "World").Why it happens: In mathematics and Julia, string concatenation is non-commutative (A * B != B * A), so * is used.
How to fix: Always use * or string("Hello ", "World") to combine strings.
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.
Construct a Formatted Message
Set `item = "Processor"` and `cores = 8`.
Create a formatted string using interpolation: `message = "System: $item with $cores cores"`.
Print `message` using `println`.
Finished reading and practicing?
Mark this lesson as completed to update your course progress.