Hi every one
I need a function count numbers in a list for example
(count-numbers '(3 4 5 a b c d 6 ) ) -> 4
counts number in a list
Forum rules
Please respect your teacher's guidelines. Homework is a learning tool. If we just post answers, we aren't actually helping. When you post questions, be sure to show what you have tried or what you don't understand.
Please respect your teacher's guidelines. Homework is a learning tool. If we just post answers, we aren't actually helping. When you post questions, be sure to show what you have tried or what you don't understand.
Re: counts number in a list
You can use the loop macro (search for a count clause) with a numberp predicate.
cl-2dsyntax is my attempt to create a Python-like reader. My mirror of CLHS (and the dark themed version). Temporary mirrors of aferomentioned: CLHS and a dark version.
Re: counts number in a list
let, dolist, incf, and numberp would also work.
A recursive helper function could be used to eliminate the let, dolist, and incf; some classes prefer recursive solutions.
A recursive helper function could be used to eliminate the let, dolist, and incf; some classes prefer recursive solutions.
Re: counts number in a list
Tnxxxxxxxxxxxxxxxxxxxxxxxx