Student Testimonials:
Student Testimonials:
The course is extremely well organized with tons of great explanations and exercises for each and every topic imaginable. The instructor is a very good teacher, and gives great feedback, while rapidly answering any questions you may have. Highly recommend the course to anyone interested in Python or programming in general. - Sathvik H.
The most comprehensive and personalized learning experience in a programming course. Highly recommend to anyone interested, regardless of experience. - Danny N.
The instructor is great. Everything is really well explained. Appropriate for complete beginners as a intro to programming if that is needed. Also good if you are coming from other languages. The instructor also speaks super clearly. - Jon
Learn to Code with Python is a comprehensive introduction to programming in Python, the most popular programming language in the world. Python powers codebases in companies like Google, Facebook, Pinterest, Dropbox, and more. It is used in a variety of disciplines including data science, machine learning, web development, natural language processing, and more.
Over more than 58 hours of video content, we'll tackle the language from A to Z, covering everything you need to know about Python to be an effective developer in 2020.
The course is jam-packed with:
58+ hours of video, with new content added frequently
FREE 300-page PDF study manual with all the code samples written throughout the course
60+ coding challenges that you can complete in your browser
40+ multiple-choice quizzes
35+ written assignments
Complete programming projects including Texas Hold-Em Poker
Learn to Code with Python is designed from the ground up to take you from novice to professional. Complete beginners are welcome; no prior experience is needed. Over 400+ videos, we'll work our way from language fundamentals to advanced features. Topics covered include...
Setup & Installation
Variables
Data types
Functions and Methods
Control Flow
Lists and tuples
Dictionaries
Sets
Modules
Decorators
Classes
Exception Handling
The Python Standard Library
Unit testing
Regular Expressions
Virtual Environments
Web Scraping
...and more.
Throughout the entire journey, I'll be coding alongside you step by step in the code editor. You'll also have the opportunity to test your knowledge through numerous coding challenges, quizzes, and written assignments.
Python holds a special place in my heart it was the first language I ever learned. I'm honored to be able to pass on years of knowledge to a new group of avid learners. Whether you are a novice who's never written a line of code before or an experienced developer looking to dive into a new language, there’s something for you to enjoy in Learn to Code with Python.
Thanks for checking out the course.
Welcome to Learn to Code with Python! In this introductory lesson, we'll explore the history and purpose of the Python programming language, and take care of some basic housekeeping for the course.
Get to know a little about your instructor.
Discusses the differences between the complete and incomplete course files.
Download a PDF containing all the code written in the Learn to Code with Python course.
Provides helpful notes for following along with installation videos.
The Terminal is an application for issuing text commands to the operating system. Long before graphical interfaces, programmers used the Terminal to interact with their computers. Today, the Terminal still offers many advantages -- it's much faster and offers more options for customizing commands. In this lesson, we introduce 3 of the most popular commands needed to interact with the Terminal.
The pwd (print working directory) command to output the current directory
The ls (list) command to output all files and folders in the current directory
The cd (change directory) command to navigate up and down across directories.
In this lesson,, we head to the official Python website to download the latest version of Python, 3.8. We run through the installation process and then verify proper installation by issuing a few Terminal commands.
Download and install the VSCode code editor on a macOS computer.
In this lesson, we introduce the Command Prompt, an application for issuing text commands to the operating system. We walk through common commands for navigating across the filesystem, displaying files and folders, and creating / deleting directories. You'll use the Command Prompt occasionally throughout the course to run Python files.
In this lesson, we download and install the latest version of Python for our Windows computers. We walk through the steps of the installer and verify that the setup was successful.
Microsoft's Visual Studio Code will serve as our text editor throughout the course (although you are welcome to use any editor of your choice). In this lesson, we download and install VSCode for our Windows machine.
In this lesson, we take a quick tour of the VSCode interface including the project explorer, the search tab, and the extensions tab. We also include some popular shortcuts for navigating around the editor and working with text.
Python offers its own command line application called the interactive prompt. This is a quick and dirty playground where we can experiment with Python. No code is saved to a file for later use. In this lesson, we discuss the process for launching and terminating the prompt, and run a few sample commands.
Test your knowledge of the basics of Python.
In this optional lesson, I'll share a few tips and tricks that I wish someone had told me when I was learning to code. Programming is an arduous task and it's important to approach it with patience -- you're not going to learn to code over a day, a week, or a month. It requires a consistent effort over several hundreds of hours of practice.
This article wraps up Section 1 and offers a preview of the features in the course.
Everything in Python is an object. An object is a data structure, a way of storing digital information. The first object we'll dive into is a string, a collection of zero or more characters in order. In this lesson, we use string literal syntax to declare several strings and begin a discussion on the concept of immutability.
A function is a sequence of one or more steps. It's an procedure, a routine, a set of instructions for Python to follow to accomplish a task. There are functions built into the core language and functions that the developers can define. Functions can accept inputs called arguments and produce outputs called return values. In this presentation, we explore the idea of functions with the analogy of a cooking recipe.
The declaration of a value (like a string) does not output it to be seen. The print function is a built-in tool which prints its argument(s) to the screen. In this lesson, we invoke the print function with a variety of inputs including strings, numbers and mathematical expressions. We also introduce concatenation, the process of combining two strings together.
We've started our exploration of Python! This quiz tests your knowledge of strings and the print function.
The print function accepts any number of sequential arguments. It will print them all out, separating each with a default delimiter of a single space. In this lesson, we continue practicing invoking the function and observing the results.
A parameter is the name of an expected input to a function. The argument represents the actual value passed to the parameter when the function is invoked. In this lesson, we use keyword argument syntax to pass the print function the sep and end parameters. These customize the characters placed between subsequent printed objects as well as the string placed at the end of all output.
A comment is a line of text that is ignored by Python interpreter. Developers can use comments to leave documentation, explain the reasoning for a technical decision, or even temporarily disable one or more lines of code. In this lesson, we use the hashtag symbol (#) to turn lines into comments.
Learn more about the in-browser coding exercises scattered throughout the course.
See how to solve the problems in the previous coding challenge.
Review all the concepts introduced in the Welcome to Python section of the course!
An expression is a Python statement that is evaluated. Expressions require the use of operators. An operator is a special symbol that carries out some kind of operation, such as a plus sign for addition. The values to the left and right of an operator are called operands. In this lesson, we introduce operators for addition, subtraction, concatenation, multiplication, and exponentiation.
Python 3 offers two options for division: floating point division with / and floor division with //. In this lesson, we discuss the differences between the two approaches. We also introduce the modulo operator (%) for returning the remainder of a division operator.
Test your knowledge of the mathematical operators for addition, subtraction, multiplication, division, floor division, exponentiation, modulo and more!
A Boolean is a special data type that can only be one of two values: True or False. The majority of the time, the Boolean is a data type that you’ll arrive at from some evaluation. In this lesson, we introduce the equality operator (==) and the inequality operator (!=) for comparing the equality / inequality of two different objects.
The equality and inequality operators are not the only ways to arrive at Boolean values. Python also includes various mathematical operators for testing relationships like less than, greater than, less than or equal to, and greater than or equal to. In this lesson, we introduce the characters for these operations.
We've covered quite a few mathematical operators: equality, inequality, greater than, less than, and more. Test your knowledge of Boolean mathematical expressions with this short quiz!
The type function returns the class that an object is constructed from. A class is a blueprint or template or a schematic for creating objects. An instance is an object from a class. In this lesson, we invoke the type function with a variety of objects including integers, floating points, strings, Booleans and more.
Test your knowledge of the type function.
In a complex program, data may not always arrive in the type that we need to store it as. Python is bundled with several helper functions to convert one object to another. In this lesson, we introduce int for converting an object to an integer, float for converting an object to a float, and str for converting an object to a string. We also discuss situations where Python performs automatic type conversion for us.
A variable is a name assigned to an object. It's a label or placeholder or an identifier for an object. A good real-life analogy is the address of a house. In this lesson, we declare and assign variables to a variety of different data types. We conclude with a discussion on Python's dynamic type system and how it compares to the statically typed systems in languages like Java and C++.
Python has a collection of reserved keywords. These are words (such as len and print) that are defined and used within the language itself. As developers, we cannot use these words for our variable names. This article features a complete list of the keywords as well as additional tips related to the naming of variables.
Python allows us to assign multiple variables to the same value or the same object. There is also a shorthand syntax available to assign multiple values to multiple variables on the same line. In this lesson, both options are discussed.
The augmented assignment operator acts as a shortcut for overwriting a variable value based on its current or existing value. In this lesson, we discuss the original syntactical option for overwriting a value and why the augmented assignment operator proves more beneficial.
Python's built-in input function collects user input from the Terminal as a string. In this lesson, we practice prompting the user for input, then collecting it in a variable, and displaying it back. We conclude by developing a program that adds two numbers from the user together.
Errors are a regular part of programming and they come in many different forms -- syntactical, logical, even language-specific. When an error occurs in Python, the interpreter produces a traceback, a record and summary of the exception. In this lesson, we introduce 4 error varieties -- NameError, ValueError, TypeError, and SyntaxError -- and debug their issues from the traceback message.
Test your understanding of the concepts introduced in the Variables section of the course!
A function is a collection of one or more Python statements that accomplishes a goal or task. In this lesson, we define a simple function that outputs three lines of text to the screen. We also discuss how functions allow for code organization, structure, and reuse.
A parameter is the name of an expected input to a function. The argument is the actual value provided for the input when the function is invoked. In this lesson, we expand on the foundation from the previous lesson to define a function with a single parameter. We discuss what happens when the function is invoked with an insufficient number of arguments.
Arguments can be passed to a function in two ways: sequentially without parameter names or with keyword arguments. In this lesson, we define a base add function and practice invoking it in a variety of formats. We conclude by showing how a single invocation can include both positional and keyword arguments.
An output from a function is called a return value. Functions return an output with the return keyword. In this lesson, we modify our add function to return its calculation instead of just printing it.
Default arguments are fallback arguments that are passed to a function if the invocation does not include an explicit value for that parameter. In this lesson, we continue expanding our add function to be able to provide default arguments.
In this lesson, we introduce None, a special object used to represent nothingness or nullness or the absence of a value. If an explicit value is not returned from a function, Python will implicitly return None. In this lesson, we declare a function without an implicit return to observe the effect in action.
An annotation is an additional piece of information about something, much like a footnote in a book. Function annotations allow us to add metadata or additional information about the expected type of each function argument as well as its return value. In this lesson, we discuss the special colon and arrow syntax to declare types.
Welcome to the Strings: The Basics section of the course. In this one, we’ll be exploring the string data type in depth. This lesson begins with a discussion of the len function to obtain the number of characters in a string, followed by a review of concatenation and the concept of immutability.
Each character in a string is assigned a numeric position that represents its place in line. That position is called the index, sometimes also called the offset. The index position starts counting at 0. In this lesson, we practice extracting various characters from a string by using square brackets to index into a given index position.
The square brackets used to extract a character from a string also accepts a negative integer. The value represents the element to pull out relative to the end of the string. For example, -1 means the last character and -2 means the second-to-last character. In this lesson, we practice the syntax with a sample programming string.
Test your knowledge of string indexing, the art of accessing a character in a string by its relative position.
Multiple characters can be extracted from a string using slicing syntax, which combines square brackets with one or more numbers. The number to the left of the colon indicates the starting index and is inclusive. The number to the right of the colon represents the ending index and is exclusive. There are also shortcuts available to pull from the beginning of a string or to the end of a string.
Review the slicing syntax for extracting multiple characters from a string using both positive and negative index values
In this lesson, we continue practicing with string slicing syntax. We also introduce an optional third number to the square brackets, which represents the stride or step interval. This is the amount of index positions that will be jumped over between every character extraction.
Test your knowledge of slicing in steps (aka intervals) by providing a third number to the square brackets.
An escape character is a symbol that the Python interpreter treats differently from regular text. In this lesson, we introduce the \n character for line breaks, \t character for tabs, as well as special characters for escaping single quotes, double quotes, and backslashes.
In this lesson, we introduce the in and not in operators for checking for the presence of a substring in another string (a concept known as inclusion). Both of the operators return a Boolean value -- either True or False. The operators are inverses of each other. If in returns True, the not in operator will return False, and vice versa.
In this section, we'll explore a variety of methods available on a string object. A method is a function that acts upon a specific object. Much like functions, methods are invoked, they can accept arguments, and they can return values. In this lesson, we introduce the find and index methods which return the lowest index in the string where a substring is found. We also discuss the differences between the two.
The startswith and endswith methods check for the inclusion of a substring at the beginning or end of a string. As always, case sensitivity matters. In this lesson, we practice invoking the two methods.
The count method returns an integer that represents the number of times a substring argument appears in a string. In this lesson, we discuss the semantics of this method, including what happens when the argument has more than 1 character.
A string is bundled with several casing methods to convert it to lowercase, uppercase, and everything in between. All of these methods return a new string object. This lesson explores 5 of these methods and provides a quick review of immutability.
Methods on an object may return an object of a different type. In this lesson, we explore 7 methods on a string that test its characteristics (for example, the characters being all digits or all lowercase). These methods all return a Boolean value - True or False.
OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.
Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.
Find this site helpful? Tell a friend about us.
We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.
Your purchases help us maintain our catalog and keep our servers humming without ads.
Thank you for supporting OpenCourser.