iOS Functions in Swift Functions in Swift Recap: Functions

Emilio Robres
Emilio Robres
2,728 Points

Why doesn't work?

Why doesn't work?

functions.swift
// Enter your code below
func temperatureInFahrenheit(temperature: Double) -> Double {
let celcius = ((temperature * 9) / 5) + 32
return celcius
}

temperatureInFahrenheit(temperature: 24.0)
let fahrenheitTemp = temperatureInFahrenheit

1 Answer

Logan R
Logan R
22,823 Points

Hey!

You're super close. You just need to combine your last two lines into one:

let fahrenheitTemp = temperatureInFahrenheit(temperature: 24.0)