← Back to challenges

Is the Number Less than or Equal to Zero?

PythonMediumconditionsvalidationlanguage_fundamentals

Instructions

Create a function that takes a number as its only argument and returns True if it's less than or equal to zero, otherwise return False.

Examples

less_than_or_equal_to_zero(5) ➞ False

less_than_or_equal_to_zero(0) ➞ True

less_than_or_equal_to_zero(-2) ➞ True

Notes

  • Don't forget to return the result.
  • If you get stuck on a challenge, find help in the Resources tab.
  • If you're really stuck, unlock solutions in the Solutions tab.
python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Buggy Code (Part 4)