//: Playground - noun: a place where people can play

import UIKit

var myname : String

//print(myname) : error

var myphone : String? = nil

myphone = "this is a test"
if (myphone != nil) {
    print("myphone : \(myphone!)")
}

myphone = nil
if let str = myphone {
    print(str)
}

// prints optional string , if count > 5 character

var str : String?
str = "MohammadMehdi"

if let temp = str, temp.characters.count > 5{
    print("str : \(temp)")
}


class Car {
    var model : String?
    init() {
        self.model = nil
    }
}


var mycar : Car?

mycar = Car()
mycar?.model = "FORD F150"

if let car = mycar , let model = car.model {
    print("model : \(model)")
}

