Hi, please could you read this and then alter you code to use code tags so the code is indented correctly, indenting is important in python.

Due to the reasons discussed here we will be moving to python-forum.io/ on October 1 2016This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.

You call it twice inside your loop, i think you probably want getPentagonalNumber to return a value rather then print it, then only call it once for each loop and use the value it returns.

Due to the reasons discussed here we will be moving to python-forum.io/ on October 1 2016This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.

The code you posted last doesn't even have 16 lines.Your still printing inside getPentagonalNumber, i didn't think you wanted it to print.Your still not returning a value from getPentagonalNumber.Your if statement has no code after it.when you post an error give the traceback as asked for in the link i asked you to read in my first post here it is again.http://www.python-forum.org/viewtopic.php?f=6&t=145

Due to the reasons discussed here we will be moving to python-forum.io/ on October 1 2016This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.

for i in range(1, 101): pentNum = getPentagonalNumber(i) # get the return value here if i % 10 != 0: print(format(pentNum, "6d")) # use the returned value here else: print(format(pentNum, "6d"), end=" ") # use the returned value here

Due to the reasons discussed here we will be moving to python-forum.io/ on October 1 2016This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.

Error one you need to correct the indentation only use 4spaces for a tab not a real tab

Error two you are trying to use a variable called number before you have defined it

Due to the reasons discussed here we will be moving to python-forum.io/ on October 1 2016This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.

look at the line before it , it is indented 8 spaces then you next line is only 3 spaces as the previous was an 'if' then next line should be indented 12 spaces.

Note when you've corrected that one look at the indentation for the lines that follow it

Due to the reasons discussed here we will be moving to python-forum.io/ on October 1 2016This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.

Due to the reasons discussed here we will be moving to python-forum.io/ on October 1 2016This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.

return False # number is not a prime ^IndentationError: expected an indented block

still getting that same error. I have done a small tutorial, I have also been watching the MIT open source Intro to Computer Science on iTunesU. This is for a 8 week class through a college that has the worst text book ever. Nothing is explained so you do not know how to take examples and convert it to work with the problems. It also does not show how to tie everything together.

Due to the reasons discussed here we will be moving to python-forum.io/ on October 1 2016This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.

Ok so this is my code from yesterday the only issue is I am not getting prime numbers rather I am getting even numbers for the first set. I have no idea what I am doing wrong to get even numbers for the first set.