Given and When Statement

Let's introduce the "given" statement, its basic syntax, and how it is written with an example.

We'll cover the following

The given-when construct

Typically, this is required when different actions need to be performed based on different values of a particular expression. The basic construct of a given statement is as follows:

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy