Richard Ricardo's example page of Python programming language.
Objective | Description |
---|---|
Download & Install | Go to Python.org Download the latest version for Windows Create folder "python" in in c: drive, c:\python\ Double-click on the downloaded .exe file to install python for windows Choose Customize install > Next > Change "Customize install location" to c:\python\ Note: Python is case sensitive. |
Write the first program using IDLE - do this one, easiest |
Search for IDLE, OR Windows Icon > Python > IDLE Open IDLE, you will see "Python --- Shell" print ("hello") Note: IDLE is Python’s Integrated Development and Learning Environment. To save file... Create folder c:\temp\python Show File Extensions in Windows - video 00_002 In IDLE > File > New File File > Save As... c:\temp\python\helloworld.py Type: print ("hello world") File > Save OR Ctrl-S Run > Module or F5 |
Write the first program using Interactive Shell |
Search for Python, OR Windows Icon > Python > Python Type: print ("hello") |
Write the first program using notepad++ | Do not try this if you have not programmed before Install notepad++ (if you have not done so) - video 00_001 Show File Extensions in Windows - video 00_002 File Explorer > go to c:\temp\python\ Create new text document, name it cmd.bat, put in the following... cmd.exe Double click on cmd.bat Type the following (same to a text file, commands.txt, for future use) set path=%path%;C:\python Type this to run file python helloworld.py |
Others / Extra | Dr. Coleman's notes 1 for Python Coding Camp |
Objective | Description |
---|---|
values, comments, variables, strings, type casting |
right-click on file > Edit with IDLE |
user input | eg002.py (eg002.txt) |
string formatting, control string | eg003.py (eg003.txt) |
Others / Extra - Turtle graphics | Dr. Coleman's notes 2 for Python Coding Camp python_session2_turtle.py (python_session2_turtle.py) |
Others / Extra | Dr. Coleman's notes 3 for Python Coding Camp |
Objective | Description |
---|---|
expressions, arithmetic | eg004.py (eg004.txt) |
mixed type expressions | eg005.py (eg005.txt) |
simple program example |
Fahrenheit to Celsius, Celsius to Fahrenheit |
Objective | Description |
---|---|
boolean expressions, if .. else .. statements | eg007.py (eg007.txt) |
and, or, not |
eg008.py (eg008.txt) |
Objective | Description |
---|---|
while loop Yes or No, uppercase |
|
while loop |
eg010.py (eg010.txt) |
for loop | eg011.py (eg011.txt) |
nested loops | eg012.py (eg012.txt) |
GAME - guess my number 1 to 10 | game001.py (game001.txt) |
Objective | Description |
---|---|
using function | eg013.py (eg013.txt) |
using math, time functions etc. |
eg014.py (eg014.txt) |
writing functions | eg015.py (eg015.txt) |
writing function turtle graphics | eg016.py (eg016.txt) |
Others / Extra - Turtle graphics | Dr. Coleman's dice.py (dice.txt) Dr. Coleman's maze.py (maze.txt) |
Objective | Description |
---|---|
Others / Extra - Turtle graphics | Dr. Coleman's pong.py (pong.txt) |
Other / Extra - matplotlib | Dr. Church's Game of Life |