120 likes | 261 Views
Python. Chapter one. What we will look at today. Roles of Hardware and software The study of computer science Understanding the basic design of the modern computer Understanding the form and function of computer languages Begin using Python. Computers – The Universal Machine.
E N D
Python Chapter one
What we will look at today • Roles of Hardware and software • The study of computer science • Understanding the basic design of the modern computer • Understanding the form and function of computer languages • Begin using Python
Computers – The Universal Machine • Adding machines add • Typewriters type • Computers…well, computers do almost everything “a machine that stores and manipulates information under the control of a changeable program”
The study of computer science • “Computers are to computer science what telescopes are to astronomy.” EdsgerDijkstra • Not about the tool, rather about the process. What can be computed? • Techniques used to answer that question: • Design • Analysis • Experimentation
Design • The development of algorithms • Only answers the question what is computable in the positive
Analysis • Studying algorithms mathematically to determine computability • Some problems are unsolvable – they cannot be represented algorithmically • Some problems are intractable – they can be solved, it just takes an unrealistically long time. The Answer to Life, the Universe, and Everything = 42 ~Deep Thought (7.5 million years)
Experimentation • Actually implementing systems to determine their viability
Hardware Output Devices CPU Input Devices Secondary Memory Main Memory
Programming languages • Well defined, unambiguous syntax and semantics • Compiled – converts source code to machine code • Interpreted – simulates a computer that understands the language
Python • Open Idle • Add 5 + 5 Discuss parameters • Create a function that takes a parameter and outputs a message using the parameter
Chaos • Create chaos – opening a new window • Type in code • Save it • Recall it • Run it • Let’s take a closer look • Reusable pieces • Libraries