Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialBethany Norton
4,818 PointsI think I might be trying to do this in the wrong section of code. Example of code below
$count_less_than_one = 0;
$count_between_one_and_thousand = 0;
$count_greater_than_thousand = 0;
foreach ($numbers as $number) {
$count_less_than_one = count($numbers < 1);
$count_between_one_and_thousand = count($numbers);
$count_greater_than_thousand =count($numbers > 1000);
2 Answers
Ken Alger
Treehouse TeacherBethany;
A hint for this challenge would be that we only want to increase the value for the $count_greater_than_thousand
variable if the number is greater than 1000. Looks like a good use of a conditional, yes?
Happy coding,
Ken
Bethany Norton
4,818 Pointsthanks Ken.
Ken Alger
Treehouse TeacherKen Alger
Treehouse TeacherEdited for markdown.