For loop. stuck


#1

I'm stuck on

Solo For Loop!



<?php
// Write your for loop below!
for ($i = 10; $i < 101; $i= $i+ 10) {
echo $i;
}
?>




No matter what I do I keep getting the error that they will never fix. actually, THEY NEVER EVER EVER fix any of the bugs.

Replace this line with your code.


#2

What are the instructions??


#3

Write a for loop that counts up by 10, all the way to 100 (e.g. 10, 20, 30...). Inside the for loop, echo the current value of $i, just like in the examples above



Solo For Loop!



<?php
// Write your for loop below!
for ($i = 10; $i < 11; $i = $i + 5) {
echo $i;
}
?>




#4

I keep getting infinite loop error even if I copy and paste the example code. Again nothing ever gets fixed on this site.


#5

can you please post the lesson link?


#6

https://www.codecademy.com/courses/web-beginner-en-L83Do/0/3?curriculum_id=5124ef4c78d510dd89003eb8


#7

<html>
  <head>
    <title>Solo For Loop!</title>
  </head>
  <body>
    <p>
      <?php
      // Write your for loop below!
        for ($i = 10; $i < 101; $i= $i+ 10) {
            echo $i;
        }
      ?>
    </p>
  </body>
</html>

#8

It doesn't matter what I do I keep getting the same error and even If I do fix the code. I fix the code, submit and it just sits there. Refresh the page same thing before I can even type I get the same error. This has been a problem for a few years now from the others I've read.


#9

instruction:
Write a for loop that counts up by 10, all the way to 100 (e.g. 10, 20, 30...). Inside the for loop, echo the current value of $i

your code:

for ($i = 10; $i < 11; $i = $i + 5) { // counts up by 10 all the way to 100
echo $i;

so your code should look like

 for ($i = 10; $i < 101; $i = $i + 10) {
    echo $i;
}

#10

Again, I have done all I possibly can to get it to pass and it still doesn't do anything but throw an error even with correct code.
This has been an issue for some years now and it has never been fixed.


#11

can you please post the screen shot?


#12


#13

Never mind I fixed it myself.


#14

Thank you for the replies. They are much appreciated.


#15

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.