booleans and if statements

var cool = false
cool = true
// flip cool 
if cool {
    cool = false
} else {
    cool = true
}

wallet = 20
if wallet > 10 {
    wallet = 15
}

dog = "miki"
if dog == "miki" {
    "your dog"
}
if dog != "miki" {
    "not your dog"
}

你可能感兴趣的:(booleans and if statements)