lec-03
onlinequestions.org
202304170103Let's do a brain dump: write down everything you can remember - words, phrases, pictures, whatever - about things we covered in lecture and lab last week.
You've got 1 minute.
⦾ hardware & the measly 7 things
⦾ software
⦾ Hello, Python (on a Codespace)
⦾ printing stuffs
⦾ variables
Last week, we spent some time up here, solving simple problems by making algorithms for people to follow.
This week, we'll spend time down here, learning how to write algorithms in Python, a language that a computer's hardware can understand (with some help).
c. curtis
This is a very high level view of hardware, from a programmer's point of view
hardware
c. curtis
c. curtis
hardware
c. curtis
hardware
c. curtis
hardware
c. curtis
7 measly things!
read from an input device
write to an output device
read a value from storage
write a value to storage
"do math"
branch
loop (i.e. repeated branching)
all possible because of 7 measly operations
software
// Hey there - I'm written in C++
#include <iostream>
using namespace std;
int main() {
cout << "Greetings, citizen." << endl;
}// Hey there - I'm written in Java
class Greeting {
public static void main (String[] args) {
System.out.println("Greetings, citizen.");
}
}# Hey there - I'm written in Python
print("Greetings, citizen.")high-level languages
# Hey there - I'm written in Python
print("Greetings, citizen.")new kid in town on our GitHub org page
Demo dat, Pratt.
Demo dat, Pratt.
Yup.
read from an input device
write to an output device
read a value from storage
write a value to storage
"do math"
branch
loop (repeated branching)
let's do some of this
print()Demo dat, Pratt.
(Yes, it's weird that we use "print", because no paper is involved. Sigh.)
ouch
print('this','that')
print('this','that' sep='*')
print()
print('this')
print('that')
print('this',end='...')
print('that')Demo dat, Pratt.
predict!
print("foo\nfoo")
print("foo\tfoo")
print("foo\bfoo")
print("\u2639")
print("\u26FA") print(3)
print(3.14) # yes to decimals
print(-400) # negs are ok
print(02) # !! nope
print($120.12) # not really a number4825 Mount Royal Gate
Calgary, AB
T3E 4K2
Write the following address 2 ways:
Name Nickname
Jordan "JP"
Cassie 50¢
Write the following table.