Write your code: Disarium Number#

Write a function that determines whether a number is a Disarium (True) or not (False).

Function definition#

def is_disarium(n):

    # write the code here
  File "/tmp/ipykernel_2080/1194074982.py", line 3
    # write the code here
                         ^
SyntaxError: unexpected EOF while parsing

Testing#

Check if your function returns the expected value using the cell below.

import unittest

class UnitTests(unittest.TestCase):
    def test_type(self):
        self.assertEqual(type(is_disarium(10)), type(False), 'The function should return a boolean operator')
    def test_true(self):
        self.assertEqual(is_disarium(89), True, 'The function should return True for the value 89')
    def test_false(self):
        self.assertEqual(is_disarium(100), False, 'The function should return False for the value 100')

unittest.main(argv=[''], verbosity=2,exit=False)