Set up Python and run your first program
In this module: Python code is written in plain text and executed by the Python interpreter. A development environment helps you edit and run files, while the terminal displays output and errors.
minStart programming with Python through variables, data types, decisions, loops, collections, functions, files, debugging and a guided project.
minutes · Self-paced
Learn Python without assuming previous programming experience. Begin with the development environment and basic syntax, then work with variables, strings, numbers, input and output, conditions, loops, lists and dictionaries. Write reusable functions, handle errors, work with simple files and debug your code. Each module includes a small coding task, building toward a practical command-line project.
No previous coding experience is required. A computer and Python environment or browser-based editor are recommended.
In this module: Python code is written in plain text and executed by the Python interpreter. A development environment helps you edit and run files, while the terminal displays output and errors.
minIn this module: Variables give names to values so they can be reused. Strings represent text, integers represent whole numbers, floats represent decimal numbers and Booleans represent true or false.
minIn this module: input() reads text from the user and print() displays output. F-strings include values inside a message. Validate information you receive and remember input is text until converted.
minIn this module: Conditional statements let a program respond to different situations. Comparison operators test relationships and Boolean operators combine conditions. Consider boundary values so the program behaves correctly at a threshold.
minIn this module: A for loop iterates over a sequence, while a while loop repeats while a condition remains true. Use a clear stopping condition and update loop variables to avoid endless repetition.
minIn this module: Lists hold ordered collections of values and can be changed. Dictionaries store key-value pairs, making it easier to retrieve information by a meaningful label.
minIn this module: Functions reduce repetition and make a program clearer. Parameters provide input and return sends a result back to the caller. Keep each function focused on one responsibility.
minIn this module: Files let data remain available after a program closes. The with statement helps close a file safely. Exceptions help a program handle expected problems such as missing files or invalid numbers.
minIn this module: Syntax errors stop code from running, runtime errors occur while it executes and logic errors produce incorrect results. Test normal, boundary and invalid inputs. Break a project into functions.
min