Python
Explore the Flashcards:
An open-source, high-level programming language known for its simplicity and readability. It supports multiple programming paradigms and is used widely in various fields like web development, data science, and artificial intelligence.
Open Source Software (OSS)
Software whose source code is made freely available for modification and distribution. It encourages collaborative development from multiple independent sources.
A general-purpose programming language
Refers to programming languages designed to be used for writing software in a wide variety of application domains, rather than being specialized to a specific field.
High-level programming language
A type of programming language that is more abstracted from the hardware and focuses on easy and intuitive reading and writing of the code. High-level languages are more user-friendly and closer to human language compared to low-level languages.
Machine Languages
A basic level programming language, consisting of binary code (0s and 1s) directly understood by a computer's CPU. They are highly hardware-specific and difficult for humans to read or write.
Source Code
The human-readable set of instructions written in a programming language that a programmer writes. It needs to be compiled or interpreted into machine code for a computer to execute.
Program
A set of instructions written in a programming language that performs a specific task when executed by a computer.
Programming
The process of designing, writing, testing, debugging, and maintaining the source code of computer programs.
Coding Environment
The set of tools and software used for writing and testing software. This includes text editors, integrated development environments (IDEs), compilers, and interpreters.
Variables
Named storage locations in computer memory used to hold data that can be modified during program execution. Each variable in Python has a specific type and a name.
Command
An instruction given by a user or a program to a computer to perform a specific task.
Command Execution
The process of performing an instruction or a set of instructions by the computer to solve a given programming designated task.
Operands
A value or a variable used for calculations. For example, in the expression 5 + 3, 5 and 3 are operands.
Operators
A symbol performing operations on operands.
Case Sensitivity
In programming, case-sensitivity refers to the ability of a programming language to distinguish between uppercase and lowercase letters. For example, in Python, variable names are case-sensitive, which means that we must pay attention to the use of lowercase and uppercase letters when writing code.
Statement
A unit of code that the Python interpreter can execute, like a command or an instruction. Examples include print statements, assignment statements, or a for loop.
Value Error
A Python error that occurs when a function receives an argument of the correct type but an inappropriate value.
Syntax Error
An error that occurs when the Python interpreter encounters code that does not conform to the syntax rules of the language. It prevents the program from running.
Data Type
Refers to the classification of data such as 'integers', 'strings', 'lists', 'tuples', and 'dictionaries'.
Integers
A Python data type that represents whole numbers, both positive and negative, without decimals.
String
A data type used for representing text. It is a sequence of characters enclosed in quotes, either single ('string') or double (""string"").
Floating-points (floats)
A data type used to represent real numbers, including decimal points.
type() function
A built-in function that returns the Python object type. It is used to find out the data type of a variable or a value.
int() function
A Python built-in function that converts a specified numeric or string value into an integer.
float() function
A Python built-in function that converts a specified numeric or string value into a floating-point number.
Boolean value
An object representing a True or a False value in a logical expression.
str() function
A built-in function that converts the specified value into a string.
Trailing Comma
A comma placed at the end of a list of items in an object such as a list, a tuple, a dictionary, or a function parameter list.
Arithmetic operators
Operators like addition (+), subtraction (-), multiplication (*), division (/), modulo (%), and exponentiation (**).
Remainder in Python (% operator)
An arithmetic operator that returns the remainder of the division of two numbers.
Multiplication in Python (* operator)
An arithmetic operator used for calculating the product of two numbers.
Power in Python (** operator)
An arithmetic operator used to raise a number to the power of another number.
Double equality sign (==)
A comparison operator used for checking if two values are equal. It returns True if the values are equal, otherwise False.
Reassigning values
Changing the value stored in a variable. For example, executing x = 5 followed by the execution of x = 10 changes the value assigned to x from 5 to 10.
Comments
Text strings used for documentation and explanation throughout the source code. They start with the # symbol and are not executable.
Line Continuation
A method in Python where a single statement is written in multiple lines for better readability. This can be achieved by using the backslash character (\) indicating the end of a line.
Indexing elements
Refers to accessing an element from a list, string, or other data structures, by using its position (index). In Python, indices start from 0.
Block of code
A group of statements that serve a specific scope.
Indentation
Indentation refers to the number of empty spaces used at the beginning of a code line. For instnce, In Python we often use indentation to define blocks of code.
Comparison operators
In Python, these include == (equal to), != (not equal to), > (greater than), < (less than), >= (greater than or equal to), and <= (less than or equal to).
Logical operators
Operators used to combine conditional statements. The Python logical operators are and, or, and not.
Order of logical operators in Python
This refers to the precedence of logical operators when evaluating an expression. In Python, not has the highest precedence, followed by and, then or.
Identity operators
Identity operators (is and is not) are used to determine whether two variables reference the same object.
Conditional statements
Statements executing different blocks of code based on certain conditions.
Control flow
This refers to the order in which individual statements, instructions, or function calls of a program are executed.
If/Elif/Else
In Python, if checks a condition, executing its code block if True. elif (else if) allows for additional checks when if is False, running its block when True. else executes its block when all if and elif conditions fail.
Function
A block of reusable code, used for performing a single action, that only runs when it is called. Functions can accept arguments and return data as a result.
Keyword
Words having a special meaning and purpose for Python's control flow and that cannot be used as an identifiers of an object. Examples include if, for, while, return, etc.
Parameters
In programming, parameters are the named variables in a function that act as a placeholder for values when the function is called.
Arguments
In programming, arguments are the values that are assigned to the parameters defined in the function when the function is called.
return
In Python, the return statement is used in a function to end the execution of a function and returns a value.
return vs. print in Python
return sends a value back to the caller and ends the function execution, whereas print outputs a value to the console. return does not display the output, but print does.
Multiple parameters in a function
Functions in Python can accept more than one parameter, allowing them to receive and operate on multiple pieces of data.
Built-in functions
Functions that are pre-defined in Python and are readily available to use. Examples include print(), len(), type().
Python abs() function
A built-in function that returns the absolute value of the provided argument.
Python sum() function
A built-in function that returns the sum of all the items in an iterable (like a list or tuple).
Python round() function
A built-in function used to round a number to a specified number of decimal places or to the nearest integer if no decimal place is specified.
Python pow() function
A built-in function that returns the value of a number raised to the power of another specified number.
Python max() function
A built-in function that returns the largest item from an iterable or the largest of two or more arguments.
Python min() function
A built-in function that returns the smallest item from an iterable or the smallest of two or more arguments.
Pyton len() function
A built-in function returning the length of an object, that is - the number of items that the object contains. It can be used on various object types such as strings, lists, tuples, and dictionaries.
List
A mutable, ordered sequence of items. Lists are versatile and can contain items of different objects as well, including other lists.
del
A Python keyword used to delete objects. It can be used to remove individual items from a list, slices from a list, or entire variables.
Method
A function that is associated with an object. In object-oriented programming, methods act on the object and its data.
Python .append() method
A method used to add a single item to the end of a list.
Python .extend() method
A method used to add multiple items (from another iterable like list, tuple, set) to the end of a list.
Slicing
A feature retrieving part of a sequence (like a string, list, tuple or other iterable objects). It is done by specifying a start index and an end index, separated by a colon.
Python .sort() method
A method that sorts the items of a list in a specific order (either ascending or descending). It modifies the list in place.
Tuples
An immutable, ordered sequence of items. Tuples are similar to lists but cannot be modified after they are created.
Immutable objects
An object whose state cannot be modified after its creation. This is a key feature of tuples in Python.
Packed values
In Python, packing refers to the organization of multiple arguments into a single iterable object. For example, executing packed = 1, 2, 3 immediately creates a tuple, called packed, containing the three integers.
Tuple assignment
A Python feature where a tuple of values is used to assign values to several variables simultaneously. For example, x, y = (1, 2) assigns 1 to x and 2 to y.
Comma-separated values
Data separated by commas, like in a CSV file or in tuple creation (1, 2, 3).
Python .split() method
A string method used to split a string into a list of substrings based on a specified delimiter.
Dictionary
A mutable, unordered collection of items. Each item is a key-value pair, allowing for fast retrieval of a data value by using keys as a reference.
A key-value pair (in a Python dictionary)
A set of two linked data items: a key, which is unique within a dictionary, and a value associated with that key.
Python .get() method
A method used for dictionaries that returns the value associated with a specified key. If the suggested key is not found, the method returns a specified default value or ""None"" if such value has not been provided.
Iteration
Looping through the elements of a data structure, like a list or a dictionary, and performing operations on each element.
For loop
A control flow statement in Python used for iteration over a sequence (like a list, tuple, or string) or other iterable objects.
Increment operation
An increase of a variable's value, typically by a fixed amount, called an increment. In Python, this is often done with the += operator.
While loop
A control flow statement in Python used for a repeated statement execution as long as a specified condition is true. It's often used when the number of iterations cannot be known beforehand.
Infinite loop
A never-ending Python loop. This occurs when the loop's condition is always true. Executing an infinite loop is often an error unless intentionally applied for a continuous process.
Python range() function
A built-in function generating a sequence of numbers. It is often used for looping a specific number of times in For loops.
How many iterations will this for loop make?
6
Is this loop infinite?
Yes.
Range object
An immutable sequence type, often used for looping a specific number of times in For loops.
Object-oriented programming (OOP)
A programming paradigm based on the concept of ""objects"", where ""objects"" are data structures containing data in the form of fields, and ""code"" is represented in the form of procedures. E.g. in Python, everything is an object.
Object Instance
In OOP, an instance of a Python object is a specific realization of the class defining the given object type.
Class
In OOP, a class is a blueprint for creating objects (a particular data structure), providing initial values for state (attributes) and defines the behavior (functions or methods) that the given objects can have.
Attributes
In OOP, attributes are data stored inside a class or instance that represent the state or quality of the class or instance. In Python, attributes are accessed using the dot . operator.
Module
A file containing Python definitions and statements serving a specific problem-solving purpose. A module can define functions, classes, and variables.
Package
A collection of modules related to a specific problem-solving area (such as statistics or machine learning) where the modules are organized into a hierarchy.
Python Standard Library
A collection of core Python modules, providing a wide range of functionalities like network communication and data manipulation.
Python math module
A module in the Python Standard Library that provides access to mathematical functions like trigonometric functions, logarithms, and others.
Python sqrt() function
A function in the math module that calculates and returns the square root of a given number.
Python help() function
A built-in function in Python used to display the documentation of modules, functions, classes, keywords, etc.
Software documentation
Written text or illustration that explaining how the given piece of software operates and how to use it.