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)
( = b 4 (number? b) (not b)))))
Are you after something like this?
;; 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)))
(is-equal-to-4 2) ; #t
(is-equal-to-4 4) ; #f
More information about the conditionals
cond etc.; 3.12 Conditionals: if, cond, and, and or
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.