Python for Teens
Write real programs: games, quizzes and calculators from your first line of code
Technology & ProgrammingWrite real programs with variables, loops, lists, dictionaries and functions
Finish the 12 lessons (about 2 h 15 min) and pass the 20-question final exam. Your Certificate of Completion is ready the moment you pass.
Python is the most popular first programming language for good reason: its code reads almost like English, it runs everywhere, and the same language powers websites, data analysis, automation scripts, scientific research and machine learning. This free course teaches you to write real Python programs from zero, in one sitting.
You'll start by running your first program and learning how Python stores information in variables: numbers, text and true-or-false values. You'll do arithmetic the way Python does it (including the operators that surprise beginners, such as integer division and remainder), work with strings and f-strings, and read input from a user while converting it to the right type.
Next you'll teach your programs to make decisions with if, elif and else, and to repeat work with while and for loops and the range function. Then you'll organize data with Python's four core collections: lists, tuples, dictionaries and sets. Finally, you'll package code into reusable functions, read error messages calmly, handle errors with try and except, work with files, and import modules from Python's large standard library.
Every lesson explains why the code behaves as it does, shows short programs line by line, and names the mistakes beginners make most often, from forgetting that input returns text to off-by-one errors in ranges. Practice comes in many forms: predicting output, finding bugs, completing code and ordering lines into working programs.
The course is for adults with no programming experience, and for people who have copied scripts before and want to understand them. You can earn a free certificate of completion by passing the final exam.
Run your first programs, learn how Python reads code, and store information in variables of different data types.
Do arithmetic the way Python does, format and slice strings, and turn user input into numbers you can calculate with.
Make programs choose between paths with if, elif and else, and repeat work with while loops, for loops and range.
Store many values together in lists, tuples, dictionaries and sets, and choose the right collection for each job.
Package code into reusable functions, handle errors gracefully, read and write files, and use modules from Python's standard library.
20 questions drawn from a pool of 36. Score 70% or more to pass; retakes get a fresh set of questions.
What does the line print("7 + 3") display?
Answer: B. 7 + 3
The quotes make 7 + 3 a piece of text, so Python prints the characters exactly as written: 7 + 3. Without the quotes, print(7 + 3) would calculate and print 10. The quotes themselves are not printed.
You can start in a free online Python editor in your browser. For regular practice, install Python 3 from python.org and use a simple editor such as IDLE (included with Python) or a code editor like VS Code. Make sure you use Python 3, not the retired Python 2.
You can learn the fundamentals in this course in a few hours, and become comfortable writing small useful scripts with a few weeks of regular practice. Specialized areas such as web development or data science take months, but they all build on these basics.
Python is widely used in data analysis, automation, web back ends, testing, scientific computing and machine learning, and it appears in many job descriptions. A beginner course is a first step; employers usually want to see projects that use the language to solve real problems.
The interactive steps focus on reading and predicting code, finding bugs and completing programs, which builds the skills you need before writing longer programs. Type every example into your own Python session as you go; running code yourself is the best practice there is.
Practice by automating a small task you actually have, such as renaming files or cleaning a spreadsheet. Then explore classes and objects, virtual environments and pip packages, and a focus area such as data analysis with pandas or web development with a framework.
No. It is a certificate of completion showing you finished the lessons and passed the exam. It shows initiative, but it is not an academic credential or a vendor certification.
Write real programs: games, quizzes and calculators from your first line of code
Technology & ProgrammingVariables, functions, arrays, objects, the DOM and async code
Technology & ProgrammingTrack changes, branch safely and collaborate with pull requests
Technology & ProgrammingCode real browser games with variables, loops, canvas drawing, keys and collisions
Technology & ProgrammingAlgorithms, loops, if-then, variables and bug hunting, then write real JavaScript
Technology & ProgrammingMatch, extract and replace text with regex in JavaScript, Python and your editor
Technology & Programming