It’s important you understand the difference between
var in Swift.
letis used to declare a constant that you cannot change later.
varis used to create a variable that you may change later.
For example, to create a constant, use
let num = 100.0
And to create a variable, use var like this:
var x = 200
Swift advises you to create constants whenever possible. You can see this in action when Xcode shows you warnings about using var. This is helpful because it prevents you from accidentally changing values that are not meant to be changed.
var‘s only when you need to change the value in the future.