I have been trying to write a function in racket which takes one argument returns its opposite so in my example i have been trying to set b to equal 4 and if any other value is entered it should return true but in my case every value entered is false i would appreciate some help with this
(define A (λ (b)
(cond
( = b 4 (number? b) (not b)))))
#lang racket
;; is-not-equal-to-4 : n : number -> boolean
;; this function checks if a number is not equal to 4,
;; and returns #true or #false
(define (is-not-equal-to-4 b)
(not (= b 4)))
;;tests
(is-equal-to-4 2) ; #t
(is-equal-to-4 4) ; #f
Can you be more clear about the inputs and outputs of your function? What kinds of values should you be able to call the function with? For a range of plausible inputs, what is the corresponding output? I can't figure it out from your description.