Swift | Sololearn: Learn to code for FREE!

+2

Swift

let myPoint = (1, -1) switch myPoint { case let (x, y) where x == y: print("(\(x), \(y)) is on the line x == y") case let (x, y) where x == -y: print("(\(x), \(y)) is on the line x == -y") case let (x, y): print("(\(x), \(y)) is just some arbitrary point") } In this program what does \x and \y do or mean exactly . Pls reply fast i really am confused Thank you so much

7/14/2019 2:42:35 PM

Svojas Pitale

1 Answer

New Answer

+3

\(x) and \(y) allow you to insert the value of x and y into a string.