easy +5 pts

Perimeter of triangle

Compute the perimeter of a triangle given its three side lengths.

Write a function `perimeter(a, b, c)` that takes three numeric values representing the side lengths of a triangle and returns the perimeter. The perimeter is the sum of the three side lengths.

Constraints

Input values are numbers (integers or floats). The function should return a number. All side lengths are non-negative and may be zero. No validation of triangle inequality is required.

Example

>>> perimeter(3, 4, 5)
12
>>> perimeter(2.5, 3.0, 4.5)
10.0
5 points ~5 min

Recent Submissions

No submissions yet — hit Run Tests to try!

Hints

Add the three parameters together.
Return the result directly.
Consider what happens with zero values.
Python 3
All tests passed!
Test Results
Press Ctrl+Enter or click Run Tests to execute your code.