Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 11 Online
OpenStudy (anonymous):

Python seems very inconvenient when I make a mistake. If I make a syntax error, it looks like I need to rewrite all my code. How can I go in and edit out a stupid mistake that I made without re-writing all the code?

OpenStudy (anonymous):

When I create a program, how does someone else open it up or test it? All I know is that I wrote some code, but it’s all in computer language. How do I open it up so that it doesn’t look like an actual program?

OpenStudy (anonymous):

You should attach your code with the question.

OpenStudy (anonymous):

First question, I made a mistake on this coding.... >>> fName = raw_input('What is your first name?) SyntaxError: EOL while scanning string literal --why can't I just go in and edit the simple syntax error? I am just missing the single quote. Now it seems like I need to re-write the line of code. This is a very simple question that I need to know, otherwise I will waste a lot of time making mistakes, and then re-writing. Second question, how do I write a program that anyone is able to use? Seems like I am answering my own question, is that the point? How does anyone run a program where I actually ask the question so they can enter their name? >>> fName = raw_input('What is your name? ') What is your name? Dave >>> print ('Your name is ' + fName) Your name is Dave >>> Thanks to anyone who can help with the absolute basics.

OpenStudy (vaboro):

Learning is the path of trial and error. In order to start writing programs others will use, you need to know a lot about the issues to be resolved by computation and how to perform the computations. You don't need to rewrite the lines of code if you are running the code from a script file. Only if you're typing into the prompt line you will need to rewrite the whole lines. Just create script files and run scripts every time you're finished with the script. This way you will be able to make adjustments to the syntax.

OpenStudy (anonymous):

There are 3 ways to write code using Python: 1) via the IDLE - Integrated Development Environment 2) The Command Prompt and 3) You can write Scripts by selecting the Python Shell and starting a 'New Window'. The first two methods are interactive because they allow you to test out your code and receive immediate results. You cannot edit the code once it's been executed in interactive mode. Script files allow you to run your programs after saving them in the (.py) extension for Python. It's like a note pad or word processor for your code. You can edit and save it for execution at anytime.

OpenStudy (anonymous):

Thanks, I finally got around to taking a close look at your answer. Exactly what I was looking for. I got Python to work as it does in the video.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!