Python Formatting, Comments & Macros (println!)
Rust macros like println! and format! use curly braces ({}) as placeholders for positional parameters, and {:?} for Debug printing. Semicolons denote statements in function bodies.
"The {} placeholder in println! is like a customized name badge holder where you slot in the visitor’s card at print time."
Deep Dive: How It Works
Display ({}) vs Debug ({:?}): Display formats for end-user readability, while Debug prints internal structural state.
Semicolons: Semicolons turn expressions into statements. A line ending with a semicolon returns the unit type ().
Comments: Use // for line comments and /// for doc comments formatted in Markdown.
Syntax Blueprint
println!("Value: {}", val); | println!("Debug: {:?}", obj);Use {} for Display types and {:?} for types implementing the Debug trait.
Core Rules to Remember



Common Beginner Traps & How to Fix Them
Trying to print an array or tuple with {}.Why it happens: Complex compound structures do not implement the Display trait by default.
How to fix: Use the debug formatter {:?} or {:#?} (pretty-print) instead.
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.
Print formatted system telemetry
Inside fn main(), declare let host = "node-01"; and let memory_mb = 512;
Print "Host: node-01 | Memory: 512 MB" using println!.
Finished reading and practicing?
Mark this lesson as completed to update your course progress.