You're looking at Less Wrong's discussion board. This includes all posts, including those that haven't been promoted to the front page yet. For more information, see About Less Wrong.

JayDee comments on What are you working on? July 2013 - Less Wrong Discussion

8 Post author: David_Gerard 02 July 2013 04:39PM

You are viewing a comment permalink. View the original post to see all comments and the full post content.

Comments (100)

You are viewing a single comment's thread. Show more comments above.

Comment author: Prismattic 07 July 2013 05:17:55AM *  0 points [-]

I've decided to teach myself python, following MIT's online intro CS course. I'm on lesson 2, and so far, I've mainly reinforced my pre-existing impression that I'm not a particularly intuitive coder (my day job has nothing to with programming; it just seemed like it couldn't hurt to develop another skill).

I realize I'm probably misusing the thread asking this, but if someone can explain the first syntax error in the following snippet, I'd be most appreciative. I assume it has something to do with the way I'm nesting the conditionals, but I've played around with it quite a bit without success (If there's more than one syntax error, just correct the first one, since that's what has me stuck. I'd rather try to puzzle out further glitches on my own first).....

divisor = 3
lastprime = 3
primecount = 2
While primecount < 1000:
lastprime = lastprime + 2
while divisor < lastprime:
if lastprime % factor != 0:
divisor = divisor + 2
else: lastprime = lastprime + 2 and divisor = 3
primecount = primecount + 1
print ("The thousandth prime number is")
print (lastprime)

As an aside -- there is apparently no relationship between aptitude for learning natural languages (I speak four with varying degrees of fluency) and learning synthetic languages, as the above mess presumably shows.

Comment author: JayDee 07 July 2013 12:30:07PM 1 point [-]

First syntax error I got was the capital W in While, should be all lowercase.