Python Fundamentals
Python is a general-purpose programming language built around readable source code, dynamic objects, functions, modules, and a large standard library. It is widely used for automation, web services, data work, scientific computing, and machine learning.
itProgramming languages | OpenSkills.info
Intro
Python Fundamentals
Python is a general-purpose programming language. You write source code as statements and expressions. A Python interpreter executes that code using objects, names, functions, modules, and exceptions.
Use one mental model:
source code → parser/compiler → bytecode or implementation form → interpreter
↓
objects + side effects
Python language behavior is defined by the language reference. CPython is the most common implementation, but implementation details are not universal language guarantees.
Names refer to objects
Assignment binds a name to an object.
items = [1, 2]
alias = items
alias.append(3)
Both names refer to the same list, so the mutation is visible through both names.
count = 2
count = count + 1
The second assignment binds count to a different integer object. It does not mutate the original integer.
This distinction explains many Python behaviors:
- parameters receive references to objects;
- mutable objects can change in place;
- multiple names can share one object;
- rebinding one name does not rebind another;
- identity and equality answer different questions.
Use == to compare values. Use is for object identity, most commonly with None.
Core scalar types
Python includes:
Nonefor absence of a value;boolforTrueandFalse;intfor integers;floatfor binary floating-point numbers;complexfor complex numbers;strfor Unicode text;bytesfor byte sequences.
Floating-point numbers cannot represent every decimal fraction exactly. Do not use binary floating point for exact decimal accounting without a suitable decimal representation and explicit rounding rules.
Text and bytes are different. Decode bytes into text with a known character encoding. Encode text into bytes when writing to a byte-oriented boundary.
Collections and mutability
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.
