← Back to challenges

A Simple Task

PythonHardmathnumbers

Instructions

Mubashir needs your help in a simple task.

Create a function which takes a number n and return its decimal part.

Examples

decimal_part(1.2) ➞ 0.2

decimal_part(-3.73) ➞ 0.73

decimal_part(10) ➞ 0
python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Calculate the Shortest Distance Between Two Points