## A community for students. Sign up today

Here's the question you clicked on:

## StudentTeacher 3 years ago I'm feeling very inspired yet slightly inept. These MIT courses are very inspiring to me, but i did not have any sense of how to programatically solve the 1000th prime program from watching the video and seeing the PDF assignment. That made me feel a bit inept as i was reading the forum and seeing that people were like these are the values and this is how you run the loop to the 1000th prime. I felt like i missed some of the material. I'm confused on the statement i saw in the forum - for x in range(2, 11, testnumber): Can someone explain that?

• This Question is Closed
1. maitre_kaio

You don't have to feel inept. As any other field of the human knowledge, some people are more inclined to understand it than others, but anyone can make it to a decent level if he perseveres and keeps asking for help. (Oh, what a wonderful sentence I made! Since I'm french, I hope it makes sense in English too :-) ). So, I don't know where you took this example from, but that's what that "for x in range(2, 11, testnumber)' means: I want a variable x to enumerate through all the values starting with 2, up to 11, with a step which is the value of the variable testnumber. And for each different value of x, I want to make a process defined inside the for loop (else my loop is completely useless). You could try this program to visualize the result: testnumber = 1 for x in range(2, 11, testnumber): print x And give to testnumber different values, just to see the results.

2. bwCA

there are readings as well as lectures - they are a must - there is a link in the upper left section of the course maon page. The Tutorial in the Python documentation is indispensable - the documentation should have been installed on your computer. http://docs.python.org/tutorial/index.html How to think like a computer Scientist is a good start

3. StudentTeacher

Thanks for the support! I have some programming experience from work and was frustrated after trying to solve the problem from lecture 2. After watching Lecture 3 I felt a bit better as people in the class didn't have answers for the teacher as he was asking for solutions to one of his problems. I am trying to get some of my fundamentals learned. As i look at code sometimes i just see things i don't get and that havn't been explained to me from the class videos . I will keep trying. I love the fact that many of the coding ideas i have other people have thought about and amazingly they are often willing to help others!!!

4. student47

feel easy.

#### Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy