Classes‎ > ‎Archives‎ > ‎2013/2014‎ > ‎ICS2O1 - Computer Science‎ > ‎

A

D

# Basics: Operators, Variables, Output, User Input

## Class 1 / Course Overview and Intro

Course overview

Computer Lab rules

Tues, Sept 3

Wed, Sept 4

## Class 2 / Intro to Python and Operators

Formal Languages

- “Drawing Twins” exercise

Intro to Python

- using the interpreter

- performing simple calculations using operators: +, -, *, /

- print statement

Exercise 0 - Intro to Python

TODO: Update notes

Wed, Sept 4

Thru, Sept 5

## Class 3 / Writing a Program

Review: Operators

Interpreter vs. Python program

- writing a script using Pyscripter

- saving a Python file

- running it, built in help, tab complete

Exercise 1 - Calculate

- discovering other things: **, math,pi

Thur, Sept 5

Fri, Sept 6

## Class 4 / Computer Languages, Formatting Output

- high vs. low level

- source code / compile / machine code

Work on Exercise 1 - Calculate

## Class 5 / Away: Technology and the Environment

In class assignment posted on website.

mr.cordiner.com/knowledge-base/shared/pcs-and-the-environment

Tues, Sept 10

Tues, Sept 10

## Class 6, 7 / Input and Variables

Quick Discussion Technology and Environment

Review: How to get set up at home

Textbook - Reading 1-1.4 (review) and 2.1-2.2

Using Pyscripter / Editor vs. Interpreter

- differences;  (), { }, []

- indenting - later this will be very important

- the __name__ main file - just delete for now

- comments are statements which don’t get executed

# Student:

# Exercise:

# Date:

# Course:

#

# Short explanation of program

Input

- using raw_input()

- get name, print hello name

- get age and print age

- get age and print age+1, what happened?

- explore types using type()

- changing input using int() and float()

Wed, Sept 11

- raw input

- didn’t start Ex 2

Thur, Sept 12

- raw_input and conversion

- started Ex 2

Wed, Sept 11

- raw input, conversion, comments and prompts

- started Ex2

## Class 8,9,10 / More Variables and Constants

Review:

- what is a variable

- what types can they be

- how to we get input, and what type is it

- how to we work with input in the wrong type?

Constants

- what is a constant

- two examples math.pi and PI =

- can you change a constant in Python?

- why do you use them?

Classwork: finish Exercise 2, work on Exercise 3 (and tomorrow)

Fri, Sept 13

- worked on Ex 2

Mon, Sept 16

- started on exercise 3

Tues, Sept 17

- reviewed Ex 3 questions 3 and 4

- some students working ahead on Ex 6

Thur, Sept 12.

- review

- few students on Ex 3

Fri, Sept 13

- constants, reviewed types

Mon

- worked on Ex 3

Tues - worked on Ex 6

## Class 11, 12 / Quiz 1, Tracing Tables and Tests Cases

Textbook - Reading 1.5-1.7 and 2.3-2.7

Tracing Table

- running through code

- writing down output

- using > and ^

- writing down variables

- including types

- updating variables

Testing

- picking appropriate values

- making sure you know the correct answer

- testing different types of cases

Wed, Sept 18

TTC photo day

Thur 19

- quiz - worked through tracing and did worksheet

Wed

- tracing tables

- worked on Ex 6

## Class 13, 14 / Flowcharts

• Why we need planning

• How and why of projects failure

• Look at flowcharts

• Flowchart symbols

• Create some flowcharts

• Creating flowcharts in Word

Exercise 5

Fri Sept 20

- flowcharts

Thur Sept 20 - quiz and flowcharts

work period to finish all work and flowcharts

Friday: worked on flowcharts

## Class 15, 16, 17 / Functions

Talk about why we use them: DRY

Look at:

• using def keyword

• good functions names

• use of indenting

• passing in parameters

• return values

• returning values vs. printing out answer

• using functions with assignment

Exercise 6 More Variables and Constants

Mon Sept  23 - looked at functions, started Ex 7

Tues Sept 24 - orientation

Ex 6 - assigned as homework

- updated Ex 7

Wed, Sept 25

- reviewed functions, especially parameters and return

Thur, Sept 26

- worked on Ex 8

Mon Sept 23

- looked at functions and Ex 7

Tues, Sept 23

- work period to finish Ex 7

Wed, Sept 25

- reviewed functions, especially parameters and return

- started Ex 8

Thur, Sept 26

- worked on Ex 8

## Class 18 / Conditional Statements

review flowcharts conditional

if and else statements

what are conditions

use of ==

Fri, Sept 27

- if and else

- took up Quiz 1

Fri, Sept 27

- covered if and else

- took up Quiz 1

## Class 19 / Quiz 2 and Conditional Statements

Boolean values - True and False

Boolean operators - and, or, not

operators - ==, !=, >, >=, <, <=