Programming Fundamentals
Programming fundamentals are the core building blocks used to write any computer program, in any language: variables that hold data, control flow that decides what runs and when, and functions that break logic into reusable pieces. This topic covers that shared vocabulary and mental model so you can read and write code before specializing in one language or paradigm.
itSoftware engineering | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Intro
Programming Fundamentals
Programming is writing an exact sequence of instructions for a computer to carry out. The computer does exactly what the instructions say, not what you meant — so the skill is learning to think in steps precise enough that a machine can follow them. Every language, from C to Python to JavaScript, gives you the same handful of building blocks to write those steps: places to store data, ways to make decisions, ways to repeat work, and ways to package logic so you can reuse it.
This course is not a language course. It uses short examples in a common syntax style to make ideas concrete, but the concepts — variables, control flow, functions, and basic data structures — hold across nearly every language you will meet. It is also not a paradigm course, an algorithms course, or a testing course. Object-oriented, functional, and declarative programming are different ways of organizing these same building blocks, and each has its own course. Algorithm design and formal testing practice are large enough topics to be their own courses too. Here you get the mechanics everything else builds on.
Variables: names bound to values
A variable is a name that refers to a value stored in memory. Assignment binds a name to a value; in most languages this is written with =. Using a name that was never assigned is an error — the program has nothing to look up.
count = 0
count = count + 1
The second line is not algebra. It reads the current value of count, adds one, and rebinds the name count to that new value. Assignment is an action, not a claim of equality.
Multiple names can be assigned at once from a matching set of values on the right-hand side. The right-hand side is fully evaluated first, then all the names are bound together — which is what makes swapping two variables' values possible without a temporary variable:
Continue the course
This section is part of the paid course.
See pricing to subscribe, or log in if you already have access.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://docs.python.org/3/tutorial/introduction.html
Supports
- The equal sign assigns a value to a variable; using an undefined name is an error
- Multiple assignment evaluates all right-hand-side expressions before any name is rebound, which is what allows swapping two variables and updating a running pair of values without a temporary variable
- Integers are whole numbers and floats have a fractional part; division (/) always returns a float, while floor division (//) returns an integer
- Strings are immutable, support indexing (0-based) and slicing, and can be concatenated
- Assigning a mutable value such as a list to a second name creates a reference to the same underlying data rather than a copy, so a mutation through one name is visible through the other
- Lists are mutable ordered collections supporting indexing, slicing, concatenation, item assignment, and methods such as append
- The tutorial's "First Steps Towards Programming" section shows a while loop computing a Fibonacci series using simultaneous multiple assignment (a, b = b, a+b)
- https://docs.python.org/3/tutorial/controlflow.html
Supports
- An if statement can be followed by zero or more elif clauses and an optional else clause; branches are evaluated in order and only the first true branch runs
- A for statement iterates over the items of a sequence in order
- break exits the innermost enclosing loop and continue skips to the loop's next iteration
- The def keyword introduces a function definition; a function with no explicit return statement returns None
- Function parameters are placeholders in the definition; the values supplied at a call site are arguments
- Variable name resolution inside a function follows the local, enclosing, global, built-in (LEGB) scope order
- Default argument values are evaluated once, at the point the function is defined, not on every call — so a mutable default (such as a list) that is mutated persists that mutation across later calls that rely on the default
- https://docs.python.org/3/tutorial/datastructures.html
Supports
- Tuples are an immutable sequence type; once created, their elements cannot be reassigned
- Dictionaries store values indexed by keys rather than by position, and dictionary keys must be immutable (such as strings, numbers, or tuples of immutable elements) — a list cannot be used as a key
- List methods such as append add items in place and typically return None rather than a new list
- https://docs.python.org/3/tutorial/classes.html
Supports
- A namespace maps names to objects; Python has local, enclosing-function, global (module), and built-in namespaces, searched in that order
- Assignments inside a function create a local binding by default unless the name is declared global or nonlocal
- https://docs.python.org/3/tutorial/errors.html
Supports
- A syntax error is detected while parsing, before the program executes, and means the code is not valid
- An exception is an error detected during execution of code that is otherwise syntactically valid, such as ZeroDivisionError or a missing dictionary key
- A try/except statement lets a program catch a specific exception type and respond instead of terminating
- https://xlinux.nist.gov/dads/HTML/recursion.html
Supports
- Recursion is an algorithmic technique where a function, to accomplish a task, calls itself with some part of the same task
- A recursive function requires a base case to terminate; without one, it keeps calling itself indefinitely
- https://cs50.harvard.edu/x/
Supports
- CS50x is Harvard's introduction to computer science, assumes no prior programming background, and explicitly teaches functions, variables, conditionals, loops, arrays, and computational thinking
- The course progresses from C to Python and other languages, including web technologies
- https://ocw.mit.edu/courses/6-0001-introduction-to-computer-science-and-programming-in-python-fall-2016/
Supports
- MIT 6.0001 is an introductory course using Python for students with little to no prior programming experience, providing lecture videos, problem sets, and solutions
- https://ocw.mit.edu/courses/6-0001-introduction-to-computer-science-and-programming-in-python-fall-2016/pages/syllabus/
Supports
- The course syllabus covers branching and iteration, decomposition and functions, tuples, lists, aliasing, mutability and cloning, recursion, dictionaries, testing, debugging, exceptions and assertions, and an introduction to object-oriented programming
- https://docs.python.org/3/tutorial/index.html
Supports
- The Python Tutorial is the official, authoritative introduction to the language's syntax and built-in data types, including control flow and function definitions
- https://xlinux.nist.gov/dads/terms.html
Supports
- NIST's Dictionary of Algorithms and Data Structures is a dictionary of algorithms, techniques, and data structures, cross-referenced by term
- https://exercism.org/
Supports
- Exercism is a free platform offering practice exercises across 83 programming languages, from beginner to advanced, with free human mentoring on submitted solutions
- https://www.codewars.com/
Supports
- Codewars offers short coding challenges ("kata") ranked from beginner to expert across 55+ languages, solved in-browser using test cases, with solutions comparable after completion
- https://github.com/freeCodeCamp/freeCodeCamp
Supports
- freeCodeCamp is a free, open-source curriculum to learn math, programming, and computer science, offering free certifications on completion
- https://github.com/ossu/computer-science
Supports
- OSSU Computer Science is a free, self-taught computer science curriculum built from online course material, structured like an undergraduate CS major, whose intro sequence covers computation, imperative programming, and basic data structures
- https://www.codecademy.com/catalog/language/python
Supports
- Codecademy offers an interactive, in-browser Python curriculum with free introductory courses alongside paid skill and career paths
