By the end of this course, you will write, run, and debug your own Python scripts to automate tasks and organize data. You will install Python and execute files from the terminal, control program flow using conditions and loops, and manage information with lists, tuples, sets, and dictionaries. You will also build reusable functions, read and write text files safely, and deploy a simple web application using Flask. Finally, you will apply basic security practices to protect your code and evaluate AI-generated scripts before using them.

Introduction to Python for Beginners
Labor Day starts with $70+ in savings on Coursera Plus. Save 40% for 3 months.
Recommended experience
Recommended experience
What you'll learn
Write, debug, and run Python scripts from the terminal to automate repetitive tasks and manage data using lists, dictionaries, and files.
Build reusable functions and deploy a simple web application with Flask while applying essential security practices to your code.
Details to know

Add to your LinkedIn profile
August 2026
2 assignments
See how employees at top companies are mastering in-demand skills

There are 7 modules in this course
Wondering how to install Python on your own computer and actually get a program to run, without breaking anything and without paying for software? This module answers exactly that question.By the end of this module you will write, run, and debug your own Python script on your own machine. You'll install Python 3 and execute a .py file from the terminal, store information in variables using the int, float, str, and bool data types, format text output with f-strings, and read a Python traceback well enough to fix the error it names.This module is designed for absolute beginners who have never written a line of code and want a working Python environment today. No prior programming experience is required and no paid tools are needed - Python and VS Code are free and open source. The module is fully self-contained: every file you need is attached, so it does not depend on any other module in this course.You'll finish with a configured Python setup plus a working, debugged profile script saved on your computer, ready to grow into your own tools.
What's included
5 videos2 readings1 ungraded lab
5 videos•Total 18 minutes
- Why Python Is Worth Your Time: Careers, Automation, and Real Use Cases•3 minutes
- What Makes Python Different: Readability, Principles, and Code Style•2 minutes
- Running Your First Python File From the Terminal•2 minutes
- Storing Values: Integers, Floats, Strings, and Booleans•6 minutes
- Reading a Traceback and Fixing the Error It Points To•5 minutes
2 readings•Total 20 minutes
- Fixing a Broken Install: PATH, Python Versions, and the VS Code Interpreter•10 minutes
- Error Diagnosis Worksheet•10 minutes
1 ungraded lab•Total 20 minutes
- Build and Debug a Personal Profile Script•20 minutes
Wondering how to make a Python program ask the user a question, decide what to do with the answer, and keep asking until the answer is valid? This module answers exactly that question.By the end of this module you will build an interactive Python program that validates user input against a set of rules and repeats until the input passes. You'll collect answers with input(), format results with print(), write if, elif, and else branches, combine conditions with and, or, and not, repeat work with for and while loops, and take precise control of a loop using break and continue.This module is designed for beginners who want their programs to respond differently in different situations - a discount rule, a validation check, a retry loop - and for anyone automating a repetitive manual task. It is fully self-contained: a starter file and a two-minute recap of variables and printing are attached, so no earlier module is required, and everything runs on a plain Python 3 install with no extra packages.You'll finish with a working password checker you can drop into any project.
What's included
6 videos1 reading1 ungraded lab
6 videos•Total 26 minutes
- How a Program Decides and Repeats: Control Flow in Plain Language•2 minutes
- How Python Judges a Condition: Comparisons, Boolean Logic, and Truthiness•2 minutes
- Collecting User Input and Printing Formatted Output•6 minutes
- Branching Logic: Writing if, elif, and else That Cover Every Case•5 minutes
- Repeating Work Automatically with for and while Loops•6 minutes
- Steering a Loop from the Inside with break and continue•4 minutes
1 reading•Total 10 minutes
- Escaping Infinite Loops and Off-by-One Errors •10 minutes
1 ungraded lab•Total 20 minutes
- Build a Password Checker That Validates Length and Characters•20 minutes
Wondering how to hold a list of customers, a set of unique tags, or a table of settings in Python instead of twenty separate variables? This module answers exactly that question. By the end of this module you will store, retrieve, update, and delete real records using Python's built-in collections. You'll create and slice lists, protect values that must not change with tuples, strip duplicates with sets, map keys to values with dictionaries, and loop through any collection to add, remove, count, or transform its items. This module is designed for beginners and analysts who can already run a Python script and now need to handle more than one value at a time - contact lists, survey answers, inventory, configuration files. It stands entirely on its own: a starter file loaded with sample data is attached, so no earlier module is required. Nothing here needs an external library; every structure used ships with Python 3. You'll finish with a clear decision rule for choosing between a list, a tuple, a set, and a dictionary in your own projects, plus a reference note-taking app you can reuse.
What's included
6 videos1 reading
6 videos•Total 27 minutes
- How Python Holds Many Values at Once: Ordered, Unique, and Keyed Data•2 minutes
- Choosing Your Container: List vs Tuple vs Set vs Dictionary•3 minutes
- Building, Indexing, and Slicing Lists•6 minutes
- Locking Values with Tuples and Removing Duplicates with Sets•5 minutes
- Mapping Keys to Values with Dictionaries•5 minutes
- Adding, Removing, and Looping Through Items in Any Collection•7 minutes
1 reading•Total 10 minutes
- Collection Cheat Sheet: What Each Structure Costs You •10 minutes
Wondering how to stop copying and pasting the same block of Python code and turn it into something you can call by name whenever you need it? This module answers exactly that question. By the end of this module you will build a small command-line utility assembled from your own functions plus Python's standard library. You'll define functions with def, pass data in through positional and keyword arguments, set sensible default values, return results instead of printing them, and import ready-made tools from math, random, and datetime rather than writing that logic yourself. This module is designed for beginners whose scripts have grown long and repetitive, and for anyone who wants to build small reusable tools instead of one-off files. It is fully self-contained: a starter script and a short syntax recap are attached, so no earlier module is required. No frameworks and no installations beyond Python 3 are needed - the standard library ships with the language. You'll finish with a working utility you can run from your terminal any time, and with the habit of splitting a problem into named, testable pieces.
What's included
5 videos1 reading1 ungraded lab
5 videos•Total 22 minutes
- Why Reusable Code Wins: Functions and Modules in Plain Language•3 minutes
- How Python Resolves Names: Scope, Namespaces, and Where Modules Live•3 minutes
- Defining and Calling Your Own Functions•4 minutes
- Passing Arguments and Returning Results•7 minutes
- Borrowing Power from math, random, and datetime•5 minutes
1 reading•Total 10 minutes
- Naming, Docstrings, and When a Function Is Doing Too Much •10 minutes
1 ungraded lab•Total 25 minutes
- Build a Random Password Generator From Your Own Functions•25 minutes
Wondering how to make Python open a real file from your computer and turn it into something useful - counts, a summary, a cleaned-up report? This module answers exactly that question. By the end of this module you will write a script that reads a text file, extracts the information you care about, and writes a summary back to disk. You'll open files in read, write, and append mode, use the with statement so files always close properly, walk through a file line by line, split and strip text, count words and patterns, and handle the file-not-found error that breaks most beginner scripts. This module is designed for beginners, analysts, and office professionals who want Python to process logs, exports, notes, and reports instead of doing it by hand. It stands on its own: sample data files and a starter script are attached, so no earlier module is required. Everything runs on a plain Python 3 install - no pandas and no external packages. You'll finish with a reusable text analyzer and a generated report file you can show as proof of work.
What's included
4 videos1 reading
4 videos•Total 16 minutes
- How Programs Keep Data After They Close: Files in Plain Language•2 minutes
- Paths, Modes, and Encoding: What Happens When Python Opens a File•3 minutes
- Opening, Reading, Writing, and Appending Files Safely•7 minutes
- Parsing a Text File and Pulling Out Only What You Need•4 minutes
1 reading•Total 10 minutes
- Handling FileNotFoundError and Never Overwriting the Wrong File•10 minutes
Wondering how to take Python off your laptop and put it on the internet as a real website that anyone can open in a browser? This module answers exactly that question. By the end of this module you will deploy a working Flask web application to a public URL. You'll install Flask, create routes that map a web address to a Python function, return dynamic content, pass data from Python into an HTML page with Jinja templates, run the development server locally, and publish the finished app on a free hosting platform such as Render or PythonAnywhere. This module is designed for beginners who can write a basic Python script and want a portfolio piece they can send to an employer, and for professionals who want to wrap an existing script in a simple interface. It is fully self-contained: a working starter app, a requirements file, and a base template are attached, so no earlier module is required. Everything runs on free tiers, and no server administration or front-end experience is expected. You'll finish with a live web app URL, its source code, and a repeatable deployment checklist.
What's included
4 videos1 reading1 assignment
4 videos•Total 15 minutes
- From Script to Website: What Happens Between a URL and Your Code•2 minutes
- Inside Flask: Routes, Templates, and Project Structure•4 minutes
- Building and Running Your First Flask App Locally•5 minutes
- Sending Python Data into an HTML Page with Templates•4 minutes
1 reading•Total 10 minutes
- Deployment Checklist: Environment Variables, Debug Mode, and Free-Tier Limits•10 minutes
1 assignment•Total 10 minutes
- Flask Basics, Templates, and Deployment•10 minutes
Wondering what separates code that merely runs from code you would be comfortable putting in front of real users - and what to learn next once the basics are behind you? This module answers exactly that question. By the end of this module you will be able to assess a small Python project for security and quality risks and name the fix for each one. You'll see how hardcoded API keys and passwords leak through public repositories, why unvalidated user input is the root of most beginner vulnerabilities, what makes eval() and unpinned dependencies dangerous, how virtual environments and pip supply-chain attacks work, and how to review code that an AI assistant wrote for you before you ship it. This module is designed for anyone finishing a first Python course and for self-taught developers who want to close the gap between tutorials and professional practice. It is entirely theoretical: no coding, no setup, and no earlier module is required, so it can be taken first if you simply want the landscape. You'll finish with a personal Python security checklist and a realistic picture of where Python is heading - type hints, performance work, data engineering, and AI-assisted development.
What's included
4 videos1 reading1 assignment
4 videos•Total 9 minutes
- How Small Python Projects Get Breached: Secrets, Input, and Unsafe Calls•2 minutes
- Installing Packages Without Inheriting Someone Else's Risk•2 minutes
- Judging AI-Generated Python Before You Trust It•3 minutes
- Where Python Is Heading and How to Keep Growing•2 minutes
1 reading•Total 10 minutes
- The Python Security Checklist for Small Projects•10 minutes
1 assignment•Total 10 minutes
- Security, Code Quality, and Python's Future•10 minutes
Instructor

Offered by
Why people choose Coursera for their career

Felipe M.

Jennifer J.

Larry W.

Chaitanya A.

Break down barriers to learning with big savings


Start with easy savings for hard-working teams

Frequently asked questions
To access course materials, assignments, and earn a Certificate, you'll need to purchase the Certificate experience when you enroll in a course. Eligible learners may also have the option to start with a Free Trial. Some courses may also offer a Full Course, No Certificate option. This lets you access course materials, submit required assessments, and receive a final grade, but you won't be able to earn or purchase a Certificate.
When you purchase a Certificate you get access to all course materials, including graded assignments. Upon completing the course, your electronic Certificate will be added to your Accomplishments page - from there, you can print your Certificate or add it to your LinkedIn profile.
Yes. In select learning programs, you can apply for financial aid or a scholarship if you can’t afford the enrollment fee. If fin aid or scholarship is available for your learning program selection, you’ll find a link to apply on the description page.
More questions
Financial aid available,

