Appendix: Python Vocabulary
Welcome to the appendix! Here, you’ll find definitions and explanations for all the important Python terms we’ve learned throughout our journey. This glossary will help you review and solidify your understanding of Python’s concepts and terminology.
Python: A high-level, interpreted programming language known for its readability and versatility.
Variable: A named location in memory where a programmer can store data and later retrieve the data using the variable name.
Integer: A whole number (without a fraction) of any length.
Float: A floating-point number, which means it is a number that has a decimal place.
String: A type of data in Python that represents text. Strings are created by enclosing the text in quotes.
Boolean: A type of data that can be either True or False.
List: A collection of data items, not necessarily of the same type, put in square brackets []. Lists are mutable, meaning they can be changed.
Tuple: A collection of data items, not necessarily of the same type, put in parentheses (). Unlike lists, tuples are immutable, meaning they cannot be changed.
Dictionary: A collection of key-value pairs, where each unique key is an index which holds the value associated with it. Dictionaries are mutable, meaning they can be changed.
Print function (print()): A function that sends data to the console. It’s commonly used for outputting information to the screen.
Input function (input()): A function that reads a line from input (usually user input), converts it into a string, and returns that string.
Concatenation: The operation of joining two strings together.
Slicing: Extracting a portion of a sequence (like a string, list, or tuple) by specifying a start and end point.
Arithmetic Operators: Symbols used to perform mathematical operations. In Python, these are + (addition), - (subtraction), * (multiplication), / (division), // (floor division), % (modulo), and ** (exponentiation).
Comparison Operators: Symbols used to compare values. In Python, these are == (equal), != (not equal), < (less than), > (greater than), <= (less than or equal to), and >= (greater than or equal to).
Assignment Operators: Symbols used to assign values to variables. In Python, these are = (assign), += (add and assign), -= (subtract and assign), *= (multiply and assign), and /= (divide and assign).
Conditional Statements: Statements that perform different computations or actions depending on whether a given condition evaluates to true or false. In Python, these involve if, elif, and else.
Loop: A programming construct that repeats a block of code as long as a specified condition is true. Python has two types of loops - for and while.
Function: A block of organized, reusable code that performs a single, related action. Functions provide better modularity for your application and a high degree of code reusing.
Module: A Python file that can define functions, classes, and variables.
Library: A collection of modules.
Remember, practice is the key to mastering these concepts. Try to incorporate these terms into your everyday coding practice. Over time, you will find these terms becoming second nature. Keep practicing, keep exploring, and keep coding!
Acknowledgements
We are grateful for the teachers and mentors who continue to inspire us. We acknowledge the assistance of GPT-4 in creating this book.