iOS Swift Basics Swift Operators Working With Operators

Dominiq Martinez
Dominiq Martinez
1,447 Points

what does it mean to compare using the equality operand and setting it equal to a constant. How can you compare in a con

These instructions lead me to code out "let isPerfectMultiple = (result == 0)

operators.swift
// Enter your code below
let value = 200
let divisor = 5

let someOperation = 20 + 400 % 10 / 2 - 15
let anotherOperation = 52 * 27 % 200 / 2 + 5

// Task 1 - Enter your code below

// Task 2 - Enter your code below

let result = value % divisor

let isPerfectMultiple  result== 0

1 Answer

Wouter Willebrands
Wouter Willebrands
iOS Development with Swift Techdegree Student 9,998 Points

Hi Dominiq,

The equality operator == is used to check wether the value on the left side is equal to the value on the right side. If it is it returns true otherwise it returns false. In this case:

let isPerfectMultiple = true

However for this specific case:

let isPerfectMultiple = result == 1

Would return false.

You can read more about operands here

I hope this answers your question. Happy coding!