Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Swift Basics Swift Operators Working With Operators

Taylor Phillips
Taylor Phillips
834 Points

What is the challenge asking for?

I don't understand what the second half of the challenge is asking for.

operators.swift
// Enter your code below
let value = 200
let divisor = 5
let result = value % divisor
let isPerfectMultiple = result == 0

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

let greater = someOperation > anotherOperation
let equal = someOperation == anotherOperation
let less = someOperation < anotherOperation
let greaterThan = someOperation >= anotherOperation

let isGreater = greaterThan == true
// Task 1 - Enter your code below

// Task 2 - Enter your code below

2 Answers

Erik Luo
Erik Luo
3,810 Points

All you have to do is to compare someOperation with anotherOperation using greater than or equal to operator, and assign to a constant named isGreater This is what I did let isGreater = someOperation >= anotherOperation

Erik Luo
Erik Luo
3,810 Points
let isGreater = someOperation >= anotherOperation
Taylor Phillips
Taylor Phillips
834 Points

Thanks, I entered it like that before I asked for help but for whatever reason it didn't except it. Thank you for the help. It works now haha

Erik Luo
Erik Luo
3,810 Points

You're welcome