Playgrounds allow writing functions and immediately running them with test inputs to see results.
Step 2: Evaluate other options
Write the function in a Swift file and compile it with Xcode without running compiles but does not run immediately; Use Swift REPL but avoid Playgrounds because it can't run functions is false because Playgrounds can run functions; Write the function in a text editor and run it later in the terminal delays testing.
Final Answer:
Write the function in Playgrounds and call it with test values to see results immediately -> Option D
Quick Check:
Playgrounds = quick function testing [OK]
Quick Trick:Use Playgrounds for instant function testing [OK]
Common Mistakes:
Thinking Playgrounds can't run functions
Confusing compiling with running
Delaying testing by using external editors
Master "Basics and Runtime" in Swift
9 interactive learning modes - each teaches the same concept differently