anonymous
  • anonymous
I am starting Pset 0. How do I write a program in IDLE. As in, I want to be able to write more than one line of code before IDLE runs my code. Thanks!
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!
eSpeX
  • eSpeX
You can either use an editor to write your code and IDLE to run it, or grab a program called PyScripter, http://code.google.com/p/pyscripter/, lovely little ide for python that is free.
anonymous
  • anonymous
from the IDLE shell window you can open an editor window with menu item File | New Window after you have written code in the editor, F5 will run it with the results displayed in the shell window. be sure to save files with a .py extension to preserve the syntax highlighting.
anonymous
  • anonymous
thanks guys! so it's a blank page. Do I need to add anything before getting started?

Looking for something else?

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

More answers

eSpeX
  • eSpeX
Just the comments for the assignment are the only thing I can think of until you start importing things.
anonymous
  • anonymous
i tried running this: x = raw_input('Please enter your birthdate (mm/dd/yyyy): ') y = raw_input('Please enter your last name: ') print x + y but it doesn't work.. am i missing something?
anonymous
  • anonymous
also are we encouraged to asked questions, or look up previous questions? if the latter, how do i do so?
eSpeX
  • eSpeX
For looking up questions you can use the codeacademy forum or google.
eSpeX
  • eSpeX
When you say that your code didn't work, what "did" it do?
anonymous
  • anonymous
it didn't prompt me for anything, and it gives back whatever i type
eSpeX
  • eSpeX
You are typing in the editor and using F5 to run it?
anonymous
  • anonymous
ah... that's why
anonymous
  • anonymous
nice it works!
anonymous
  • anonymous
Thank you so much. I'll keep working on it.
eSpeX
  • eSpeX
You're welcome. Check out PyScripter if you have some free time. I personally prefer that over the IDLE editor.
anonymous
  • anonymous
could you explain that to me a bit? like the difference between terminal and editor etc?
anonymous
  • anonymous
so i downloaded python, and then idle. did i need idle?
eSpeX
  • eSpeX
IDLE comes with Python, once you download and install the package you will have all you need to write in Python.
eSpeX
  • eSpeX
The PyScripter is an IDE for Python, basically the same as the IDLE editor, just with a better user interface.
eSpeX
  • eSpeX
The difference between an editor and terminal, is that in the terminal your commands are processed as soon as you hit the enter key.
anonymous
  • anonymous
so what's the difference between command line and GUI?
anonymous
  • anonymous
i just noticed that one is black and one is white
eSpeX
  • eSpeX
Command line typically refers to a terminal, like if you were to open the "command prompt" in windows. GUI stands for Graphical User Interface, and typically refers to a "windowed" environment.
anonymous
  • anonymous
but idle is terminal, right? and it's GUI?
eSpeX
  • eSpeX
Technically IDLE is a GUI for the terminal.
anonymous
  • anonymous
so GUI is basically just a better looking terminal, and the editor is where we actually write a program
anonymous
  • anonymous
and then what's IDE?
eSpeX
  • eSpeX
Well a GUI is a graphical representation for many interfaces, most likely you are using a GUI web browser to view this page. :)
eSpeX
  • eSpeX
An IDE is and Integrated Development Environment. It brings together many of the tasks associated with programming into a nice user interface. You are presented with buttons to build your program, vs having to run a command on the command line.
anonymous
  • anonymous
got it! thnx!
eSpeX
  • eSpeX
You're welcome.
anonymous
  • anonymous
hey when does print need parenthesis after it? i saw an example where if the variable is called x, no parentheses are used, and another where the variable is "changing," and parenthese were used...?
eSpeX
  • eSpeX
The parenthesis aren't necessary. They most likely give away that the person writing the program was a 'C' programmer.
anonymous
  • anonymous
i see..
anonymous
  • anonymous
so for pset 0 that was it right? three lines? no loops?
anonymous
  • anonymous
version 3+ of Python requires parens for the print function
eSpeX
  • eSpeX
@bwCA beat me to it, I started playing with 3.x last night and discovered that the parenthesis were in fact required. There are some other changes as well that can create a learning speed-bump, so I'd suggest you stick with 2.7.x until you are more familiar with the language.
eSpeX
  • eSpeX
And yes, that was it for your ps0, the bulk of the assignment was getting Python installed and familiarizing you with entering code.

Looking for something else?

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