Scala·Practice drills 4

Drill 18: Predict the output — Control flow

Describe the output you expect and how you would check it.

Intermediate 5 min read Lesson 93 of 150 Challenge included
What you will be able to do
  • Describe the output you expect and how you would check it.

Practice task

Describe the output you expect and how you would check it.

Flow.scalaSCALA
val score = 84
val label = if (score >= 80) "pass" else "retry"
val items = for (n <- 1 to 3) yield n * 2
println(label, items)
Your turn

Write your answer

Easy

Describe the output you expect and how you would check it.

TEXT · starter
Your answer…
Study tools

Make it yours.

Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.

Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign in
Finished reading?

Lock in what you just learned.

Mark this lesson complete to save your place and move one step closer to the certificate.

Lesson 93 of 150 · 0% of course