python chapter 1
Comments
'#' characters denote comments, which are optional but can be used to explain portions of code to a human reader.
bits
0s and 1s are known as bits (binary digits).
bits
A byte is 8 bits
program
A computer program consists of instructions executing one at a time.
disk
A disk (aka hard drive) stores files and other data, such as program files, song/movie files, or office documents.
keyboard
A keyboard allows a user to provide input to the computer.
bug
A logic error is often called a bug.
memory
A memory is a circuit that can store 0s and 1s in each of a series of thousands of addressed locations
interactive interpreter
An interactive interpreter is a program that allows the user to execute one line of code at a time.
whitespace
Any space, tab, or newline is called whitespace.
scripting languages
As computing evolved throughout the 1960s and 1970s, programmers began creating scripting languages to execute programs without the need for compilation
assembly
Because 0s and 1s are hard to comprehend, programmers soon created programs called assemblers to automatically translate human readable instructions, such as "Mul 97, #9, 98", known as assembly language instructions, into machine instructions.
integrated development environment
Code development is usually done with an integrated development environment, or IDE
IDE
Code development is usually done with an integrated development environment, or IDE.
code
Code is a common word for the textual representation of a program (and hence programming is also called coding).
newline
Each print statement will output on a new line. A new output line starts after each print statement, called a newline.
IC
Engineers created smaller switches called transistors, which in 1958 were integrated onto a single chip called an integrated circuit or IC.
integrated circuit
Engineers created smaller switches called transistors, which in 1958 were integrated onto a single chip called an integrated circuit or IC.
transistors
Engineers created smaller switches called transistors, which in 1958 were integrated onto a single chip called an integrated circuit or IC.
expressions
Expressions are code that return a value when evaluated; for example, the code wage * hours * weeks is an expression that computes a number.
int()
If a string contains only numbers, like '123', then the int() function can be used to convert that string to the integer 123
high-level languages
In the 1960s and 1970s, programmers created high-level languages to support programming using formulas or algorithms.
Computational Thinking
In the information age, many people believe computational thinking, or creating a sequence of instructions to solve a problem, will become increasingly important for work and everyday life.
Phyton
In the late 1980s, Guido van Rossum began creating a scripting language called Python and an accompanying interpreter.
machine instructions
Instructions represented as 0s and 1s are known as machine instructions
Moore's Law
Moore's Law: The doubling of IC capacity roughly every 18 months, which continues today.
syntax error
One kind of mistake, known as a syntax error, is to violate a programming language's rules on how symbols can be combined to create a program
newline character
Output can be moved to the next line by printing \n, known as a newline character.
print()
Print() displays variables or expression values.
variables
Programs use variables to refer to data, like x.
backwards compatible
Python 2.7 programs cannot run on Python 3.0 or later interpreters, i.e., Python 3.0 is not backwards compatible.
open-source
Python is an open-source language, meaning the community of users participate in defining the language and creating new interpreters, and is supported by a large community of programmers.
RAM
RAM (random-access memory) temporarily holds data read from storage, and is designed such that any address can be accessed much faster than disk, in just a few clock ticks (see below) rather than hundreds of ticks.
print()
Reading input is achieved using the input() function.
logic error
Such an error is known as a logic error, because the program is logically flawed.
string literal
Text enclosed in quotes is known as a string literal.
Python interpreter
The Python interpreter is a computer program that executes code written in the Python programming language.
Python standard library
The Python standard library includes various utilities and tools for performing common program behaviors.
string
The input obtained by input() is any text that a user typed, including numbers, letters, or special characters like # or @. Such text in a computer program is called a string, and is always surrounded by single or double quotes, for example 'Hello' or "#Goodbye# Amigo!"
prompt
The interactive interpreter displays a prompt (">>>") that indicates the interpreter is ready to accept code.
Variables
The names wage, hours, weeks, and salary are variables, which are named references to values stored by the interpreter.
operation system
The operating system allows a user to run other programs and which interfaces with the many other peripherals.
print()
The primary way to print output is to use the built-in function print()
processor
The processor runs the computer's programs, reading and executing instructions from memory, performing operations, and reading/writing data from/to memory.
runtime error
The program may have another kind of error called a runtime error, wherein a program's syntax is correct but the program attempts an impossible operation, such as dividing by zero or multiplying strings together (like 'Hello' * 'ABC').
app
The programmer-created sequence of instructions is called a program, application, or just app.
application
The programmer-created sequence of instructions is called a program, application, or just app.
program
The programmer-created sequence of instructions is called a program, application, or just app.
line
a line is a row of text
assigment
A new variable is created by performing an assignment using the = symbol.
cache
A processor may contain a small amount of RAM on its own chip, called cache memory, accessible in one clock tick rather than several, for maintaining a copy of the most-used instructions/data.
clock
A processor's instructions execute at a rate governed by the processor's clock, which ticks at a specific frequency
Input
A program gets data, perhaps from a file, keyboard, touchscreen, network, etc.
process
A program performs computations on that data, such as adding two values like x + y.
output
A program puts that data somewhere, such as to a file, screen, network, etc.
screen
A screen (or monitor) displays items to a user.
interpreter
A script is a program whose instructions are executed by another program called an interpreter.
script
A script is a program whose instructions are executed by another program called an interpreter.
Algorithm
A sequence of instructions that solves a problem is called an algorithm.
executable program
A sequence of machine instructions together form an executable program (sometimes just called an executable).
statement
A statement is a program instruction.
crash
Abrupt and unintended termination of a program is often called a crash of the program.
instruction
To support different calculations, circuits called processors were created to process (aka execute) a list of desired calculations, each calculation called instruction.
processors
To support different calculations, circuits called processors were created to process (aka execute) a list of desired calculations, each calculation called instruction.
Compilers
To support high-level languages, programmers created compilers, which are programs that automatically translate high-level language programs into executable programs.