Question

Define a predicate function mymember in Scheme language (DrRacket) that takes an atom and a simple...

Define a predicate function mymember in Scheme language (DrRacket) that takes an atom and a simple list; returns #t if the atom is in the list; #f otherwise. You are not allowed to use the built-in member function. Provide two test cases for this function.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

python:

def mymember(atom,listt):
    for i in range (0,len(listt)):
        if (listt[i]==atom):
            return '#t' #True
    return '#f' #False

Test Cases:
print(mymember(5,[1,2,3,4,5]))
print(mymember(10,[1,2,3,4,5,6,7,8]))

Add a comment
Know the answer?
Add Answer to:
Define a predicate function mymember in Scheme language (DrRacket) that takes an atom and a simple...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT