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 trial
Cheri Castro
226 PointsPython Lab for class isn't working right.
In my python lab for my current class, my initial print statement isn't printing and the rest of the code starts and then the last increment just continues infinitely.
A Basic For loop
print('I will display the numbers 1 through 5. ')
for num in [1, 2, 3, 4, 5]: print(num)
3 Answers
Andrey Misikhin
16,529 PointsIt works as expected, print number from 1 to 5.
Cheri Castro
226 Pointsbut, it keeps repeating infinitely and it isn't supposed to do that and there's a statement that is supposed to be printed firs, before the program begins to count and that isn't printing.
Andrey Misikhin
16,529 PointsI think, problem not in code. You may check it there https://repl.it/repls/JubilantHonoredIndianpalmsquirrel.
Cheri Castro
226 Pointsok, ty
Cheri Castro
226 PointsI checked it and on the link you sent, it works, in my python, it doesn't work.
Cheri Castro
226 PointsAny other suggestions? I have the print statement indented because when I try without the indention, it tells me that I need to indent the print statement. but then it still doesn't print the print statement. It just moves on to printing the numbers and when it gets to 5 it just continues to print 5 without stopping.
Cheri Castro
226 PointsCheri Castro
226 PointsThis didn't print my code out as I typed it out in Python. I'm not sure what the issue is. I'll try again.
A Basic For loop
print('I will display the numbers 1 through 5. ')for num in [1, 2, 3, 4, 5]: print(num)