This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Basic Operators | |
35 + 98 | |
62 - 14 | |
50 / 10 | |
463 * 173 | |
// Types | |
var age: Int = 21 // Int = Integer = Any whole number | |
var milesCanRun: Double = 0.75 // Double = Float = Decimal Number |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For Loop | |
for index in 1...5 { | |
print("\(index) times 2 is \(index * 2)") | |
} | |
// Array | |
let myAnimals = ["Fluffy", "Stevey", "Rabbit", "Doggy"] | |
let randomNumbers = [1, 2, 3, 4, 5] |