Programming in Swift · Challenge: For Loops | Ray Wenderlich


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/5994-programming-in-swift/lessons/14

Hi folks!
Thank you for the course!
One small question, in the first part of the challenge why do you create the constant “square”? If I use print(i*i) it gives me the same result

@a030507 It’s indeed the same thing either way, but using an intermediate constant for the square shows better what the printed value represents exactly.