This file contains hidden or 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
var brand = "Apple" |
This file contains hidden or 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
print("My favorite brand is \(brand)") |
This file contains hidden or 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
print("My favorite brand is " + brand) |
This file contains hidden or 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
var brand = "Apple" | |
var month = "April" | |
var day = 1 | |
var year = 1976 | |
print("\(brand) was started on \(month) \(day), \(year)") |
This file contains hidden or 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
var brand = "Apple" | |
var month = "April" | |
var day = 1 | |
var year = 1976 | |
print("\(brand) was started on \(month) \(day * 10), \(year / 5)") |
This file contains hidden or 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
var brand = "Apple" | |
if brand == "Apple" { | |
print("Brand is Apple") | |
} |
This file contains hidden or 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
var brand = "Apple" | |
if brand == "Apple" { | |
print("Brand is Apple") | |
}else { | |
print("Brand does not equal Apple") | |
} |
This file contains hidden or 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
var brand = "Apple" | |
if brand == "Apple" { | |
print("Brand is Apple") | |
}else if == "Uber" { | |
print("Brand equals Uber") | |
}else { | |
print("Brand not known") | |
} |
This file contains hidden or 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
let someNumber = 150 | |
switch someNumber { | |
case 150: | |
print("Number is 150") | |
default: | |
print("Number is not 150") | |
} |
This file contains hidden or 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
let someNumber = 150 | |
switch someNumber { | |
case 150: | |
print("Number is 150") | |
default: | |
print("Otherwise, do something else.") | |
} |