Functions
Definition with func, parameter/return types, and multiple return values.
Simple enough for a 5-year-old to understand
func and return
Parameter type comes AFTER the name, and the return type comes after the parentheses.
package mainimport "fmt"func square(x int) int { return x * x}func main() { fmt.Println(square(5))}🎯 Exercise & Practice
Test what you've learned — answer, write code, check instantly. (1 left)
🎯 Expected output: 17