Section 1 - Instruction

You've learned how to create functions that take parameters and return values. Now let's practice building and using these complete functions in various scenarios.

Engagement Message

Ready to create some useful functions?

Section 2 - Practice

Type

Fill In The Blanks

Markdown With Blanks

Complete this function that calculates the perimeter of a rectangle:

Suggested Answers

  • float64
  • return
  • calculatePerimeter
  • func
Section 3 - Practice

Type

Multiple Choice

Practice Question

What does this function return when called with getDiscount(120.0, 0.15)?

A. 120.0 B. 0.15 C. 18.0 D. 135.0

Suggested Answers

  • A
  • B
  • C - Correct
  • D
Section 4 - Practice

Type

Sort Into Boxes

Practice Question

Sort these function calls based on whether they correctly use the returned value or ignore it.

Function: func multiply(x int, y int) int

Labels

Sign up
Join the 1M+ learners on CodeSignal
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal