anonymous
  • anonymous
I'm on lecture 3, however I need some help with the first assignment with the program that asks your your name and d.o.b, I keep getting syntax errors and I have no idea why... Is there a source that can explain all syntax errors on this version of Python?
MIT 6.00 Intro Computer Science (OCW)
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
chestercat
  • chestercat
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
anonymous
  • anonymous
What errors are you getting? Paste your code and I'll try to help you debug it! :)
anonymous
  • anonymous
@ChrisJordan And if you tag me in the post I'll know when you've pasted it. Thanks!
anonymous
  • anonymous
Yes, please post your code. Pastebin is pretty good for that stuff :)

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

anonymous
  • anonymous
Will do as soon as I get off of work at 6pm est.
anonymous
  • anonymous
I've just done this assignment. Without seeing your code, I suppose there are a couple of places that syntax errors may occur. 1. Ensure that you have enough brackets with your raw_input command. 2. Ensure that you enclose your prompt in quote marks. 3. A good idea also is to ensure that your date of birth variable is a string type. I'll give a different example to the assignment: e.g. gen = str(raw_input('Enter your gender:')) Notice two open brackets, two closed brackets. Also notice the quotes around the prompt. Hopefully these are your only errors - when you show the code you will get a definite answer. Cheers
anonymous
  • anonymous
NameError: name 'x' is not defined
anonymous
  • anonymous
1 Attachment
anonymous
  • anonymous
I will probably figure out that it is a silly mistake
anonymous
  • anonymous
Hmmm.... It looks like you are using the command line there. Are you using the IDLE GUI to write out your code?
anonymous
  • anonymous
The attached file might help? Please other people let me know if I'm on the complete wrong track too as I'm only new to this too! If you are using a windows machine, download the file, then right click on it and choose "Edit with IDLE". Two windows should open. One is the editor and one is the shell. The example code will hopefully help.
anonymous
  • anonymous
Of course it helps if I attach the file...
anonymous
  • anonymous
Dear ChrisJordan, I have figured your problem out. The main problem of your code was that you did type a command during the execution of a command. You cannot give command during the execution of another command. When you typed >>>print raw_input('What is you date of birth?") that means your program is expecting a value to set in a variable not defined and here in the place of a value you can not call a function as it would take the function calling command as a string value of a non defined variable.Thus in the next line x has no value assigned,even it doesn't really exist and it gives a error saying x is not defined.You should try writing the following code in the first line of your program which will definitely work >>>x=raw_input("What is your date of birth?\t") remember that you can't use the print method here.But later you can write code like >>>print x My English is not good so thank you very much for reading this comment hope it will help you out.
anonymous
  • anonymous
Okay, I think I figured out Problem Set 0 out. Can one of you kind people please take a look at the attached file, let me know if this is correct and sufficient to complete the assignment?
1 Attachment
anonymous
  • anonymous
Ahh! Imagine that is what it is except add the word "birth" in lol!

Looking for something else?

Not the answer you are looking for? Search for more explanations.