Title
Introduction to Programming Basics
Notes
Program - Consists of instructions executing one at a time. Basic instruction types are:
• Input – A program receives data from a file, keyboard, touchscreen, network, etc.
• Process – A program performs computations on that data, such as aggregation.
• Output – A program puts that data somewhere, such as a file, screen.
Variables – The name is due to a variable's value "varying" as a program assigns a variable.
Python Interpreter – A computer program that executes code written in Python.
Interactive Interpreter – A program that allows the user to execute one line of code at a time.
Code – A common word for the textual representation of a program.
Line – A row of text.
Prompt – Informs the programmer that the interpreter is ready to accept commands.
Statement – A program instruction.
Expression – Code that returns a value when evaluated.
Assignment – Creating a new variable.
print() – Displays variables and expressions.
Comments – Used to explain portions of code to a human reader. Use # in Python.
Strings – Text enclosed in quotes.
print('string', end=' ') – Keeps the output on the same line.
\n – Newline character. \ – Escape sequence.
Whitespace – Any space-like character. Important and required for readability in Python.
input("text here: ") – Used to read input from a user.
Converting input types – int(input()) is an example.
Syntax Errors – Violations of the language's rules for symbol usage.
Runtime Errors – Syntax is correct, but program attempts an invalid operation (e.g., divide by zero).
Crash – Abrupt and unintended termination of a program.
Common Error Types:
• SyntaxError
• IndentationError
• ValueError
• NameError
• TypeError
Logic Errors – Program runs but behaves incorrectly. These are commonly called bugs.
Integrated Development Environment (IDE) – Software combining a text editor and interpreter.
Common IDE Features:
• Syntax highlighting
• Auto delimiters
• Keybinds
• File management
Console | Terminal – Text interface for input/output.
Command-Line Interface (CLI) – Allows user to enter commands and run programs.
Command-Line Argument – Value entered after the program name.
Example: python3 script.py [ip address]
Processors – Execute a list of instructions (machine instructions).
Memory – Stores 0s and 1s in thousands of addressable locations.
Program | Application – Programmer-written sequence of instructions.
Machine Instructions – Written in binary (0s and 1s).
Assembly – Uses mnemonics for instructions; translated by assemblers.
High-Level Languages – Use formulas or algorithms for better readability and efficiency.
Compilers – Translate high-level languages to executable code.
Computer Components (Required):
• CPU
• Motherboard
• Memory (RAM)
• Storage (HDD/SSD)
• PSU
• Chassis
Computer Components (Essential):
• GPU
• Monitor
• Keyboard
• Mouse
• Cooling
• PCI-e (Wi-Fi, GPU, etc.)
• OS
Cache – Small, fast memory on the processor chip.
Moore’s Law – Transistor count on chips doubles every ~18 months.
Scripting Languages – Do not require compilation before execution.
Scripts – Run by interpreters; slower but portable and easier to write/debug.
Python – An open-source scripting language.
Open Source – Community-developed languages and tools.