func getPrice(name: String) -> Float? {
if (name == "item1") {
return 10.0
} else if (name == "item2") {
return 20.0
}
return nil
}
var price:Float? = getPrice(name: "item")
let text = "Price is - "
let message = text + "\(price)" // compile-time error: error: value of optional type 'String?' not unwrapped; did you mean to use '!' or '?'?
print(message)