1.1 Why Program
1.1 Why Program
PYTHON FOR
EVERYBODY
Why Program?
Chapter 1
Programmers Anticipate
Needs
• iPhone Applications are a market
• Programmers have some tools that allow them to build new tools
Why be a programmer?
• To get some task done - we are the user and programmer
User
Computer
Programmer
Hardware + Software
– We figure something out and then we encode it and then give it to someone
else to save them the time and energy of figuring it out
https://www.youtube.com/watch?v=gwWRjvwlLKg
Introduction – Part 1
PYTHON FOR
EVERYBODY
the clown ran after the car and the car ran into the tent and
the tent fell down on the clown and the car
counts = dict()
python words.py
for line in handle: Enter file: words.txt
words = line.split() to 16
for word in words:
counts[word] = counts.get(word,0) + 1
bigcount = None
bigword = None
for word,count in counts.items(): python words.py
if bigcount is None or count > bigcount: Enter file: clown.txt
bigword = word the 7
bigcount = count
print(bigword, bigcount)
Introduction – Part 1
PYTHON FOR
EVERYBODY
Hardware Architecture