Elite Butterfly Scratchers
MP4 Week 5
Sorry for the delay!
See you in cyberspace on Friday!
Python is an easy to learn programming language!
You can use it to create web apps, games, even a search engine!
Python makes it very easy for you to use because it comes bundled with IDLE.
Writing "Hello World" in C++: Not as user-friendly!
Writing "Hello Word" in Python: Very user-friendly!
Programming languages differ by how they tell a computer to say "Hello World"
Downloading and Installing Python
- go to: http://www.python.org
- Click on the latest version of Python for Windows, beginning with the number 3 (near top of list)
- Install: the installer file will automatically download. When it finishes double-click it to install Python. Choose "install for all users" and click "next" at each prompt without changing the default settings.
- Run IDLE: Now check that the program installed correctly. Open the windows "start" menu, click on "all programs", "Python", and then choose "IDLE."
- A Python window opens! You can now start coding! Just type into the window after the the angle brackets (>>>).
- We'll be coding a program together in Python in chat and running it in Scratch!
Try it! Make Your Computer Say "Hello World!"
- Open IDLE (the shell window opens)
- Click the "file" menu and choose "new file" (this opens the code window)
- In the new blank code window type: print ('Hello World!')
- Make sure you used single quotation marks!
- Save the code: click "file", "save as", name it HelloWorld, and "save."
- Click the "run" menu and select "run module." (this will run the program in the shell window)
- Output: look in the shell window. The "Hello World" message should appear when the program runs! You've just created your first bit of code in Python!
*If a pop-up window appears with a SyntaxError message it often means there is a spelling mistake or typing error in the code.