This forum is now read-only. Please use our new forums! Go to forums
I think that you need to rewrite this section
Why does this not work? You need to rethink your code in the for loop section.
Answer 51a8d32af4b714de9b0009fe
Yes, editing the code from the previous exercise generates an error. I had the same experience, until I eventually deleted the previous code and coded specifically for this exercise.
Note to Codecademy: this does need to be rectified. I’m sure I’m a lot of people, like me, may have wasted valuable time trying to figure out what they were doing wrong.
Either configure the console to accept changes to the code from the previous exercise or (even better), erase the code from the previous exercise.
Here’s my code for the exercise:
<?php
// Write your for loop below!
for ($i = 50; $i >=5; $i -= 5) {
echo $i . " ";
}
?>
Answer 517ac6f3fb38ff1d7400036b
That should work. That was what I used in my code and it worked just fine. Here is what I used:
4 comments
You should maybe put an explanation with your code to help other users what they did wrong and so they understand.
You saved my life. Thank you. I was getting eternally stuck.
thanks a lot it worked
thanks for the help, i no i was right with the original code i wrote but since i passed with your code ill take it
Answer 51c775a07c82cace6b0039ac
Answer 517988b910763a03130007ee
Answer 51892460969133d78f00019c
This is mine,
for($i=50;$i > 1; $i-=5){
echo $i."<br>";
}
:)
Answer 51ce299d282ae3e0d0022e2c
These buggy excercises are annoying and a really demotivating. That we’re not able to save a certain state of code (like in the past) and everything is done automatically (and wrong!) doesen’t help either … Here I had to copy and quickly hit the button to avoid the quick (and wrong!) error message which didn’t let me do anything to pass the test. :((
Answer 51effa887c82cad429004bc8
The code seems to run before pressing the submit button. For this reason, I created an infinite loop before I had the chance to finish writing my code. The solution was to write the code in an outside editor and then paste it in all at once.
Popular free courses
- Free Course
Learn SQL
In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.Beginner friendly,4 LessonsLanguage Fluency - Free Course
Learn JavaScript
Learn how to use JavaScript — a powerful and flexible programming language for adding website interactivity.Beginner friendly,11 LessonsLanguage Fluency - Free Course
Learn HTML
Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.Beginner friendly,6 LessonsLanguage Fluency
4 comments
Passed the section only after copying and pasting the code above. This is a very serious parser problem.
i had the same problem….Passed after using your code Simon! Thanks mate
I’ve had several issues with code I know works but will not pass test here. Who ever is writing the code for this needs to realize that there is more than one way to code and it be correct.
thanks i didn’t pass this section until i updated my code with yours!:)