Introduction to Computer Programming

ICS 3C is taught using the Python programming language. Students are strongly encouraged to download and install Python on their home computer or laptop. While Python is not simple to install on a Chromebook, there are online tutorials which can walk you through the process. Alternatively, there are several online compilers students can use instead; links are at the right.

Course content

All course content is delivered through PowerPoint presentations in class and handouts and assignments in our OneNote classroom. Files in our OneNote classroom can be accessed on any computer, smartphone, or tablet using the OneNote app which can is either included in Windows or can be downloaded for free from your app store or from onenote.com.

Course outline

Unit 1: Introduction

  • What are computers?
  • What is programming?
  • Can you give instructions?
  • Getting started with Python
  • Commenting
  • Field sizing
  • Variables
  • Getting input from the user
  • Program development process

Unit 2: Control Constructs

  • If structure
  • If/else structure
  • If/else if/else structure
  • Cascading if structures
  • Boolean expressions
  • Compound Boolean expressions
  • Loops
  • Error trapping
  • Counted loops
  • Nested structures
  • Tracing program execution

Unit 3: String Manipulation

  • Strings
  • Substrings
  • Length command
  • Index command
  • Other string commands

Unit 4: Functions

  • Functions

Unit 5: File I/O

  • Writing data to a file
  • Reading data from a file
  • Reading and writing at the same time

Unit 6: Lists

  • Creating a list
  • Searching and sorting lists
  • lists and file I/O

Final Project

Ministry Course description

This course introduces students to computer programming concepts and practices. Students will write and test computer programs, using various problem-solving strategies. They will learn the fundamentals of program design and apply a software development life-cycle model to a software development project. Students will also learn about computer environments and systems, and explore environmental issues related to computers, safe computing practices, emerging technologies, and post-secondary opportunities in computer-related fields.

Course requirements

Required materials: 3-ring binder, paper, pens, pencils, highlighter, access to a computer (Windows, Linux or Mac) to install Python (free)
Suggested materials: memory stick

Resources

  1. Go to python.org; hover over Downloads and select your operating system.
  2. Download the latest Python 3 release, which at last check was 3.9.1. Select the “executable installer” version for simplest installation; it will download an executable file which you can run to install Python on your computer.
  3. Once the download is complete, run the executable to install Python. Standard installation should suit most users.
  4. The program that we will be using is not Python itself, but the added program IDLE which is installed at the same time. IDLE is the Integrated Development Environment where we will do our coding.
  5. Once you open IDLE, the first think you’ll probably want to do is go into the OptionsConfigure IDLEGeneral tab and change the following three settings:
    1. At Startup to Open Edit Window. That way as soon as you start IDLE you can start typing code.
    2. At Start of Run change to No Prompt. That way when you run your program it will automatically save your code first.
    3. Show line numbers in new windows – turn it on. It will help when I talk to you about fixing errors in your code.
  • This page is the starting page for finding information about Python.
  • The Python Standard Library describes the syntax and semantics of the Python language, which should be clearer to you as we progress through the course.
  • The Python Language Reference is a “to the point” explanation of some of the functionalities of Python.
  • The General Index is most detailed and sometimes the best fastest way to find information.

These will be referenced often as we go through the course. Links will be placed on this page for your reference.

  • This Python Tutorial is right on the python.org website.
  • W3Schools.com has some great tutorials with some interactive options so you can test code while you are learning.
  • CSCircles on the University of Waterloo website walks you through Python with instructions and interactive lessons
  • W3Resource has a large Python tutorial as well.
  • Programiz has an extensive Python section on their website.
  • The HelloWorld Program site is more lighthearted, but educational nonetheless. There’s even a paper, rock, scissors game already there for you to copy and paste, ready to play!
  • RealPython has some great tutorials, some are video tutorials which you can watch parts of before you have to register on the site

If you don’t want to install Python on your home computer you can still use one of several different online IDEs to work on your code. Make sure that whichever one you use that it is using Python 3.7.

  • GeeksForGeeks IDE is good for Python as well as many other languages. Select Python 3 and you’re good to go!
  • JDoodle is a multi-language online editor; this link takes you directly to Python 3.
  • Pythontutor is great because it allows you to visualize what your program is doing in the background while it is running
  • A good explanation and demonstration of the for and while loops on learnpython.org
  • A good tutorial on the for structure on realpython.com; this link specifically points to the use of range, but the for loop in Python is much more versatile.
  • A huge list of string methods and functions at programiz.com with sample code you can run and edit
  • More examples and explanations at W3Schools.com, also with samples you can run
  • A good explanation on the Python.org website of strings, especially substrings (slicing)
  • This dummies page shows the different methods to search a string in Python, with a good explanation of the parameters for each
  • Three ways to reverse a string in Python
  • Tutorial on reading and writing files at RealPython.com
  • PythonForBeginners provides a detailed explanation of what happens when you open a file
  • StackAbuse shows some snippets of code about handling files, how to read files, how to write files, and how to append to files
  • A lot more in-depth than what is needed in this course, DataCamp.com has a very comprehensive explanation of the functionality of File I/O, including how you can use the os module to do other file functions

Check out this page on Finxter which lists over 100 Python books online, most of which are in PDF. Take a look at some of them and let me know if you find a favourite!

  • A Byte of Python is a free online book which is used by educational institutions around the world
  • Think Python 2e is a freely available Python book which you can view in PDF or HTML
  • CodingBat.com has some quizzes for some of the concepts we cover in the course

If you find any neat resources that you would like to share, please email them to Mr. Milardovic for inclusion on the website.