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

Python

Python 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)

This 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)

3 Answers

It works as expected, print number from 1 to 5.

but, 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.

I think, problem not in code. You may check it there https://repl.it/repls/JubilantHonoredIndianpalmsquirrel.

ok, ty

I checked it and on the link you sent, it works, in my python, it doesn't work.

Any 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.