In this ICS3U lesson you will be learning how to:
You are going to be writing computer programs using the Python Programming Language
Python is an Interpreted language and thus needs the python interpreter to run the code. We can run that interpreter on our machines or through a server on the web.
It is VERY STRONGLY recommended that you have a PC/MAC to complete this course, however it is possible to complete the course using a website, its just not as user friendly.
I believe that passively acquiring information is NOT the best way to learn how to write computer programs. During portions of each lesson you will be required to complete short Interactive Learning Activities. In these activities you will be learning about small concepts and how certain pieces of code work. You will do this without having to leave the browser window and go and use different software. To accomplish this I have embedded an online website that can run python code directly in your current webpage
For example, if you click on the toggle button you will be able to open a Python Editor and type and run the code snippets that are given to you in the activities.
NOTE: YOU WILL HAVE TO DELETE THE DEFAULT CODE THAT OPENS IN THE PYTHON EDITOR AUTOMATICALLY
Open the Toggle name “Python Editor” and type the following code into the Python Editor and Run the code to see what happens
name = input("Enter your name: ")
print("Hi",name)
Make sure to hit enter after typing your name in the output window.
Delete the default code and enter the code you were instructed
These online websites are good to run small pieces of code for teaching and learning purposes, but most programmers don’t use a web based python kernel to write their programs.
The most common way to write programs in python is to use an Integrated Development Environment (IDE). An IDE contains
This is the most straightforward and lightweight way to create and run python programs on your computer. It comes built in when you download python from python.org. (If you are an HWDB student on a school board machine running windows 11, you can install python and IDLE from the “Software Center” in the Start Menu. )
Whenever you save your python files in ICS3U from an IDE they will have the .py extension. That is what you will hand in when I’m grading your work. There is nothing special about these files, it is just your program code as you have written it in the editor.
They will not however open in your IDE like regular Word or pdf files by “double clicking” them in your file manager. If you do that, then your OS will likely try to actually just run the program using the python interpreter. If you want to open and edit them, then that must be done within the IDE
Note to HWDSB Students…. Trying to send .py files in outlook email in our system likely won’t work as our security system treats them as a dangerous file.
Task #1 – Install the base version of python and the IDLE IDE
name = input("Enter your name: ")
print("Hi",name)
Task #2 – If you have successfully been able to install python on a computer and run the following code send a message to your teacher on the discussion forum. If you don’t have a computer that you are able to install the software on, please send a message to your teacher on the discussion forum immediately and he will provide you with an alternative you can use.
Note: This software can be installed (or might already be installed) on any HWDSB school board machine. or personal computer. You might have issues if you are using an School Board Machine that is not from HWDSB. Specifically Chromebooks from other school boards have caused issues in the past. Its not a huge deal, there are alternate methods, but you need to let me know immediately so I can walk you through it. CLOUD BASED ALTERNATIVES ARE AVAILABLE
