📖
Introduction to programming with Python
  • Introduction to programming with Python 3
  • Preface
    • Common misconceptions about learning to program
    • The Hard truth about learning to program
    • Personal qualities for success
  • 1 - The way of the program
    • Python Programming Language
    • The first program
    • What is debugging?
    • Glossary
    • Exercises
  • 2 - Variables, expressions and statements
    • Values, types and variables
    • Common Built-in data types
    • Expressions
    • Code Format
    • Debugging
    • Glossary
    • Exercises
  • 3 - Functions
    • Python "built-in" Functions
    • Math Functions
    • Composition
    • User Defined Functions
    • PEP 8 Recommendations
    • Debugging
    • Glossary
    • Exercises
  • 4 - Conditionals
    • Boolean expressions
    • Conditional statements
    • PEP 8 Recommendations
  • 5 - Iteration
    • The while statement
    • The for statement
    • break and continue statements
    • Nested Loops
    • PEP 8 Recommendations
    • Debugging
    • Glossary
    • Exercises
  • 6 - A short introduction to testing: Building Reliable Software
  • 7 - A deeper dive into Strings, Lists and Tuples
    • More on Strings
    • More on Lists
    • More on Tuples
    • Debugging
    • Glossary
    • Exercises
  • 8 - A deeper look at Functions in Python
    • Function Preconditions and Postconditions
    • Positional and Keywords arguments
    • Nested Functions
    • Scope of a variable
    • Recursion
    • Functions' side effects
    • Glossary
    • Exercises
  • 9 - Code Documentation
    • Basics of Commenting Code
    • Documenting Code via Python Docstring
  • 10 - Sets and dictionaries
    • Sets
    • Dictionaries
    • Which data structure should I use?
    • Debugging
    • Glossary
    • Exercises
  • 11 - File I/O
    • Read/Write to a file
    • File management
    • Debugging
    • Glossary
    • Exercises
  • 12 - Handling Errors and Exceptions
  • 13 - Writing modules
  • 14 - Classes
    • Classes and Objects
    • Classes and Functions
    • Classes and Methods
    • Pythonic Magic: Understanding and Implementing Dunder Methods
    • Glossary
    • Exercises
  • 15 - Python's Type Hinting
  • Acknowledgements
Powered by GitBook
On this page
Edit on GitHub
  1. 2 - Variables, expressions and statements

Glossary

Value: One of the basic units of data, like a number or string, that a program manipulates.

Type: A category of values. The types we have seen so far are integers (type int), floating-point numbers (type float), and strings (type str).

Integer: A type that represents whole numbers.

Floating-point: A type that represents numbers with fractional parts.

String: A type that represents sequences of characters.

Variable: A name that refers to a value.

Statement: A section of code that represents a command or action. So far, the statements we have seen are assignments and print statements.

Assignment: A statement that assigns a value to a variable.

State diagram: A graphical representation of a set of variables and the values they refer to.

Keyword: A reserved word that is used by the compiler to parse a program; you cannot use keywords like if, def, and while as variable names.

Operator: A special symbol that represents a simple computation like addition, multiplication, or string concatenation.

Operand: One of the values on which an operator operates.

Floor division: The operation that divides two numbers and chops off the fraction part.

Expression: A combination of variables, operators, and values that represents a single result value.

Evaluate: To simplify an expression by performing the operations in order to yield a single value.

Rules of precedence: The set of rules governing the order in which expressions involving multiple operators and operands are evaluated.

Concatenate: To join two operands end-to-end.

multiple assignment: Making more than one assignment to the same variable during the execution of a program.

update: An assignment where the new value of the variable depends on the old.

initialization: An assignment that gives an initial value to a variable that will be updated.

increment: An update that increases the value of a variable (often by one).

decrement: An update that decreases the value of a variable.

PreviousDebuggingNextExercises

Last updated 1 year ago