Ad

If for some reason you want to get a yes/no str when comparing two values.

Code
Diff
  • def is_equal(a: any, b: any) -> str:
        '''
        'yes' if a and b are the same value, else 'no'.
        a and b could be any datatype.
        '''
        return 'yes' if a == b else 'no'
    • def is_equal(a, b):
    • return 'no' if a != b else 'yes'
    • def is_equal(a: any, b: any) -> str:
    • '''
    • 'yes' if a and b are the same value, else 'no'.
    • a and b could be any datatype.
    • '''
    • return 'yes' if a == b else 'no'