Bird
0
0

Which of the following is the correct way to start the Swift REPL in a terminal?

easy📝 Syntax Q12 of 15
Swift - Basics and Runtime
Which of the following is the correct way to start the Swift REPL in a terminal?
Aswift run
Bswift
Cswift repl
Dswift playground
Step-by-Step Solution
Solution:
  1. Step 1: Recall the command to start Swift REPL

    Typing swift alone in the terminal starts the Swift REPL environment.
  2. Step 2: Check other options

    swift run runs a Swift package, swift repl is not a valid command, and swift playground does not start REPL.
  3. Final Answer:

    swift -> Option B
  4. Quick Check:

    Start REPL with 'swift' command [OK]
Quick Trick: Just type 'swift' to open REPL in terminal [OK]
Common Mistakes:
  • Using 'swift run' which runs packages, not REPL
  • Typing 'swift repl' which is invalid
  • Confusing REPL with Playgrounds commands

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Swift Quizzes