## phylosopher 3 years ago Hello... where can we find solutions to problem sets? Thanks!

1. pedja

In lecture where is problem set due. Look for links Instructions (PDF) Sample Solution (ZIP) Download Sample Solution, unzip it and enjoy.

2. phylosopher

Thanks Pedja. However, I'm not seeing in lecture 2. Perhaps there wasn't a solution given? I believe I have the right answer but just want to double check. For the next exercise I can see the solution in lecture 4.

3. jessejayne

Here ya go! http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00sc-introduction-to-computer-science-and-programming-spring-2011/unit-1/lecture-6-recursion/ I haven't got that far but when i ran the sample solution it returned an error. lol who knows?

4. RoamingBlue

Phylosopher, there isn't any solution for Problem Set 0 because it is just setting up your environment. Problem Set 1 You can find both the problem and solution in Lecture 4 Machine Interpretation of a Program. Problem Set 2 you can find both the problem and sample solution in Lecture 6 Recursion. The problems and solutions are ALWAYS given on the same page and they page they're on is the lecture when they are due, not when they're assigned ... so you have to look ahead a few lectures to get both the problems and the answers you should be working on at any given point.

5. phylosopher

Hi Jesse... went through the file you recommended and couldn't find the solution to ps0. RoamingBlue, there was an exercise and I was just hoping to confirm that I did the exercise right (though it does work for me). From Problem Set #0 PDF "Write a program that does the following in order: Asks the user to enter his/her date of birth. Asks the user to enter his/her last name. Prints out the user’s last name and date of birth, in that order." Here is my response dob = raw_input('Enter your date of birth: ') lastname = raw_input('Enter your last name: ') print lastname print dob Thanks!

6. RoamingBlue

Mornin' Phylosopher, You're right, there's no solution set for Problem Set 0. What you have looks absolutely right though. Here's what I have for that one if you want something to compare to (though ours are darn near identical. # Problem Set 0 # Name: RoamingBlue # Collaborators: None # Time Spent: 0:05 dateOfBirth = raw_input('Enter your date of birth: ') lastName = raw_input('Enter your last name: ') print lastName print dateOfBirth

7. phylosopher

Thanks RoamingBlue... Do you know why we Capitalize the second work in a function e.g. lastName? Just curious.

8. pedja

@phylosopher Capitalization of every word in variable name exept thr first is just naming convention. It is much easier to read myVariableHasLotsWordsInHisName than myvariablehaslots... Same is with my_variable_has... It's best to consistent, use one in program that you write. Which one, it depends on your preferences or if you work in a team which convention team adopted.

9. RoamingBlue

@phylosopher @pedja is right. It's just a convention (one I personally like) for making your variables and code generally readable. There are several widespread conventions, it's best to pick one and stick with it. Camel case notation is the one I typically use. It involves capitalizing the first letter of every word like this: myCamelCaseVariable Hungarian notation takes this one step further, and would have you prepend the variable type is the first word like this: strMyHungarianVariable (str at the start for a variable that's a string Then there's a variety of conventions which separate words in variable names with undeerscores or dashes. The recommended convention for Python is: UpperCamelCase for class names, CAPITALIZED_WITH_UNDERSCORES for constants, and lowercase_separated_by_underscores for other names. Yeah, I'm not using the recommended notation for Python, but I'm just trying to run through the exercises quickly and camel case, for some reason, is just easier for me to read. There's a good overview of conventions for python here if you want some supplementary reading: http://www.python.org/dev/peps/pep-0008/#naming-conventions

10. phylosopher

You folks are awesome... big thanks!

11. dmmmdFLL

I found several solutions by searching on google for "MIT OCW 6.00 problem set solutions". Some solutions are better than others.