The Ultimate Python Programming Tutorial

Python Programming tutorial for beginners. This Python Training Course Comes with Certification of Completion
  • Lectures 95
  • Video 7 Hours
  • Skill level all level
  • Languages English , captions
  • Includes Lifetime access
    30 day money back guarantee!
    Available on iOS and Android
    Certificate of Completion

How taking a course works

Discover

Find online courses made by experts from around the world.

Learn

Take your courses with you and learn anywhere, anytime.

Master

Learn and practice real-world skills and achieve your goals.

Course Description

In this online Python course from O'Reilly Media, you will learn how to program with the popular development language. This tutorial is designed for the beginner, and you do not need to have any experience at all with programming or development in order to learn how to program with Python using this video tutorial.

Some of the topics that this course covers throughout the ultimate Python for beginners training include installing Python, data types and creating variables, input and output, decision making and repetition, iterators, list comprehension and functions. He also covers variable scope, modules - creating and using pre-built ones, object oriented programming, inheritance, exception handling and using data structures.

By the completion of this python for beginners video based training course on Python programming, you will be comfortable with Python and how to apply it to developing applications. Throughout the course you will apply what you learn in real-world examples, reinforcing what Mike is teaching you. Working files are included to allow you to use the same source material that the author does in this training course

Take this course now online Python course and master your skill!

What are the requirements?

  • A basic understanding of web design or fundamental programming skills

What am I going to get from this course?

  • Over 95 lectures and 6 hours of content!
  • To teach real programming skills that transfer to real life development
  • Build a solid understanding of Python Programming

What is the target audience?

  • Web Masters, Programmers, Entrepreneurs

What you get with this course?

Not for you? No problem.
30 day money back guarantee

Forever yours.
Lifetime access

Learn on the go.
Desktop, iOS and Android

Get rewarded.
Certificate of completion

Curriculum

Section 1: Introduction
Working Files - Download These First
Text
What This Course Covers
03:34
Text
Instructions on how to obtain your Certificate of Completion for this Infinite Skills course. All Users of this course are eligible for a Certificate of Completion. Each certificate is issued with a unique number which allows verification that the user has undertaken the course listed. In order to o…
Section 2: Installing Python
Installing Python In Windows
03:19
Installing Python On A Mac
01:30
Section 3: Writing Your First Program - Hello, World!
Entering And Running A Program In Windows
05:10
Entering And Running A Program On A Mac
01:38
Exercise 1
03:27
Section 4: Python Basic Data Types And Variables
Expressions, Statements, Variables
05:11
Working With Numbers
03:42
Working With Strings
04:25
Working With Booleans
02:12
Working With Lists
03:04
Working With Dictionaries
02:00
Working With Tuples
02:26
Exercise 1
03:47
Exercise 2
03:28
Section 5: Python Input/Output
Using The Print Function - Part 1
04:39
Using The Print Function - Part 2
03:46
Getting Input From The User
03:51
Exercise 1
03:06
Section 6: Making Decisions - if Statements
The Relational Operators
03:19
The Logical Operators
04:50
Simple if Statement
04:19
if-else Statement
03:12
if-elif Statement
05:15
Exercise 1
03:13
Exercise 2
02:59
Section 7: while Loops
Introduction To while Loops
04:46
Count-Controlled while Loops
05:34
Event-Controlled while Loops
04:49
Using continue
04:09
Using break
04:46
Working With Files - Part 1
05:52
Working With Files - Part 2
05:05
Exercise 1
04:10
Exercise 2
04:57
Section 8: for Loops
Introduction To for Loops - Part 1
04:25
Introduction To for Loops - Part 2
04:54
for Loops With Lists
03:45
for Loops With Tuples
04:13
for Loops With Dictionaries
03:23
for Loops With Files
04:23
Exercise 1
02:57
Exercise 2
02:51
Section 9: Iterators
Understanding Iterators
02:17
Using iter And next
05:03
Iterators And Dictionaries
02:44
Other Iterators
04:27
Exercise 1
02:48
Section 10: List Comprehensions
Introduction To List Comprehensions
04:52
Using List Comprehensions With Files
03:24
Exercise 1
03:02
Section 11: Functions
Introduction To Functions - Why
04:36
Defining Functions
05:09
Calling Functions
06:16
Functions With Multiple Arguments
04:24
Predicate Functions
03:07
Exercise 1
04:35
Exercise 2
02:59
Section 12: More On Functions
Recursive Functions - Part 1
04:57
Recursive Functions - Part 2
04:38
Function Objects
04:45
Anonymous Functions
04:32
Higher-Order Functions
05:21
Exercise 1
02:50
Exercise 2
03:48
Section 13: Scope
Global Scope
03:12
Local Scope
03:02
Nested Scope
02:57
Exercise 1 - Part 1
04:14
Exercise 1 - Part 2
03:10
Section 14: Modules
Using Built-In Modules
03:57
User-Defined Modules - Part 1
03:53
User-Defined Modules - Part 2
03:23
Module Namespaces
04:15
Exercise 1
03:50
Section 15: Object-Oriented Programming - Part 1
Abstract Data Types
04:05
Designing A Class, Fields And Constructors
04:11
Designing A Class, Methods
04:28
Data Structure For Fields
04:14
Exercise 1
04:18
Exercise 2
04:34
Section 16: Object-Oriented Programming - Part 2
Creating A Derived Class - Part 1
06:59
Creating A Derived Class - Part 2
07:05
Exercise 1
04:56
Exercise 2
04:38
Section 17: Exception Handling
Exceptions Demonstrated
02:53
Try-Except Statements
04:46
Try-Except-Finally Statements
02:42
The raise Statement
02:53
Exercise 1
05:12
Section 18: Using Data Structures
Exercise 1 - Lists
04:05
Exercise 2 - Tuples
04:16
Exercise 3 - Dictionaries
03:15

Instructor Biography

Infinite Skills , High Quality Training

Infinite Skills is a Canadian based company who offer a huge and ever growing range of high quality eLearning solutions that teach using studio quality narrated videos backed-up with practical hands-on examples and comprehensive working files. All courses are created by trained educators and experts in video based education.

The emphasis is on teaching real life skills that are essential for progressing in today's commercial environment.

Join the biggest student community

6,400,000

Hours of video content

29,000,000

Course Enrollments

7,900,000

Students

Reviews

Average Rating
4.3
Details
  1. 5 Stars
    103
  2. 4 Stars
    65
  3. 3 Stars
    18
  4. 2 Stars
    4
  5. 1 Stars
    6
    • Robert DeLaurentis

    Thoughtful Instructor, good quality overall

    The audio/video quality is excellent. Easy to listen to at faster speeds when the material is familiar, but slow enough to be able to follow when needed. Excellent overview of Python syntax and usage. Useful even if you don't know programming basics already. Not much real-world examples, heavy on conceptual and syntax. Strongly reccomended.

    • Michael Burkhardt

    Too less for this money

    I have really no idea where all these good recommendations are comming from. This course is horrible, really horrible. The quality is very bad, the vids are not interesting or motivating, code is often not very precise or good style, nearly no code syntax explanation and always hopping between python 2.7 and 3.x. Its only anoying and nothing else.

    • Linda Rose

    Good introduction

    Exercises were easy to follow.

    • Evv Erb

    AWESOME course for starting python!!!

    • Kevin Alix

    Good python intro

    Easy to follow examples and well articulated lessons

Show more reviews
Ready to start learning?
Preview this course

Crafting Great Python APIs

Introduction

Good libraries are like novels -- hard to write in any language. Every language has a different definition of good. Java can't be transliterated to Pythonwell because every language has its own idioms.
"Pythonic" code is in harmony with standard libraries and conventions of Python and takes advantage of the features baked into Python. You might not think you create APIs -- you do, if only for your future self. Anywhere you present functionality to other code, even in the same codebase. Your function names, classes, command line flags, HTTP endpoints, and error messages are all part of your API.
To build a library that's easy to use, you have to put yourself in the shoes of a developer who heard about your library this morning and has a problem to solve this afternoon. Don't make them put aside all they know already. Use familiar vocabulary in your API. Reuse conventions from the rest of Python. Try to avoid surprising them with anything.

The Meaning of Craft

Craft is any process that attempts to create a functional artifact without separating design from manufacture. -- Wroblewski source

As you build your library, you will likely see rough spots that need improvement. That's normal -- try to smooth them out as they become visible instead of promising to clean it up later. Think about how your decisions will affect the finished product. Is naming this method requests.requests_get going to make it easy to remember? No, it looks confusing since you're already in a namespace. For more about simplicity and readability, take a minute to review The Zen of Python (PEP 20).

Small Considerations

Name Well

Names make code readable, it's how users most often will be thinking about your library. Avoid names like "skycopter" -- what even is that? Names need to be easy to reason about. If the name that best describes your object or function is exceptionally long, consider that it may have too many responsibilities and will be too complicated for users to understand easily. This is doubly true if it contains the name of one or more design patterns .
Use familiar words if you can. Requests has methods that match HTTP method names, which users of requests likely know already.

Function Arguments

The average human can hold five to nine chunks of stuff in their head at once; don't fill up all those slots with just your function call. If you have that many knobs on your widget, fear not. You can make sane defaults, use a configuration file, or add a wrapper class so developers don't need every parameter for every call.
Say you have a function that looks up a user on your service by their username: that requires API credentials, an API endpoint, and a user to query for.

get_user(api_user, api_token, endpoint, username):
     """Do some things to get user info"""
     pass

class Session(object):
     def __init__(self, user, token, endpoint="http://api.mysite.com"):
         self.user = user
         self.token = token
         self.endpoint = endpoint

     def user(name):
        return get_user(self.user, self.token, self.endpoint, name)

So which would you prefer to call -- get_user or Session.user? I'd prefer not to provide the arguments every time, and a class is one way to do that. Another alternative is to use functools from the standard library. A "partial" is a function that remembers some provided arguments and calls the underlying implementation.

import functools
query_user = functools.partial(get_user, user, token, endpoint)
query_user("someone")

The code above saves the first arguments to get_user and gives back a new function that only needs to be passed the username similarly to the Session class. The difference is that functools lets us skip the boilerplate code to create the object.

Magic Methods

Python has loads of standard method names associated with defined protocols. Most of them are made to integrate your objects with builtins -- think len and str. To let your object use those builtins you simply need to implement __len__ and __str__. If you find yourself writing a method like .length() ask yourself if thats what users would expect. The answer is likely "No!"

__repr__ methods

When you make an object, also define a nice __repr__ function for it -- you'll thank yourself later. By default, when you print an object, Python tells you about its location in memory.

>>> print(r) # Less helpful
< requests.models.Response object at 0x7fa4fedfbb50 >

Two lines of code are all it takes to make printing an object useful.

class Response(object):
     def __repr__(self):
         return "< Response [%s] >" % self.status_code
print(r) # Way better!
# < Response [200] >

This may not seem like much of a change, but for users new to your library or those that are using it interactively this is a huge improvement. It makes it easy to see what an object is without knowing all the fields it provides.

Generators -- A Different Way of Iterating

When you present a user with a list, you must consider their needs. Are you presenting the filename of every file on their filesystem as a list; loading every item into memory at once? If you can calculate the values incrementally, it's helpful to do so. It means you can start processing values without waiting for the full list to be loaded into memory. Consider looping over a bunch of numbers.

for i in range(1000):
     print(i)

In Python 2, that code would create a list of all 1000 digits and returned it to be iterated over. It works, but using all that memory doesn't help the caller. The caller only needs to know the next value. In Python 3, range would generate the next number only when asked. Generators are iterable, but don't produce all their values up front.
Here, we make our own generator to count up from zero.

def counter(maximum):
     count = 0
     while count < maximum:
         yield count
         count += 1

What makes a generator different from a normal function is the yield keyword. The function stops what it's doing at the yield and hands control back to whatever called it. This lets the caller (our for loop) process each result before calculating the next value. For our generator, counting to 5 million would have the same memory footprint as counting to four.

Initializing Your Library

It's easy to add setup steps for your classes in the __init__ method, but failures might leave you with some resources that need to be cleaned up. Lockfiles, open sockets, and other things need to be cleaned up whether your object finished creating or not.

a = Connection(url, port, user, pass)
try:
     a.connect()
     a.save("some data")
except:
     print("Uhoh, something went wrong!")
finally:
     a.close()

It's easy to forget to release all your resources. Python provides context managers to make the process of acquiring and releasing shared resources easier. A context manager is a simple way to ensure that initialization and teardown are easy to do correctly. To use a context manager, you open a block using the with statement and teardown is automatically done when exiting the block.

import contextlib

# library code
@contextlib.contextmanager
def connection(url, port, user, pass):
     c = Connection(url, port, user, pass)
     c.connect()
     yield c
     c.close()

# calling code
with connection(url, port, user, pass) as a:
     # the connection is initialized here
     a.save("some data")
     # at the end of the block, the connection is closed automatically

The calling code can be much simpler thanks to with. You can also see that the contextmanager is actually a decorator atop a generator function. See how nicely these compose? Context managers are useful for safely writing to files, getting transaction locks, database connections, and more.

Think Usability

Developers are people too. When I buy a power tool, I don't read the warnings. After a trip to Ikea, I don't read the instructions unless I have to. Your program is a tool, and its job is to help users. Your users want to install a library and get back to work, and a great user interface is critical to letting them do just that.

What's Up Doc?

Where is your documentation? I hear you, documentation isn't code, but it is the Application-Human Interface for your project. Without documentation you leave developers adrift on StackOverflow -- or worse, send them wading through your source code never to be seen again.
For an example of nice documentation, take a gander at the tox or sphinx docs. Both prominently feature a low-jargon description of the project. Here's the Sphinx summary:

Sphinx is a tool that makes it easy to create intelligent and beautiful documentation

And on tox's page:

tox aims to automate and standardize testing in Python

A curious developer might then say "neat, how does this tool do that?" Both pages answer immediately with code samples and feature highlights. In just a minute or two I can decide whether these are the right tools for my job.
Further down the page, there are paragraphs of additional detail and links to: extra examples, documentation, user stories, and feature lists.
For a deeper dive into documentation, check out Django contributor Jacob Kaplan-Moss' series on Writing Great Documentation. It ought to be required reading for Computer Science students. William Zinsser's book On Writing Well is an excellent guide for any nonfiction, but does not focus on technical documentation.

Exceptions and Errors

Computers break. Assumptions can be wrong. The International Space Station has six computers running all the time, checking each others' work. In space, every calculation must be correct every time. When things break in (or outside of) your library, which of these should you show?

ERROR: Data failure
ERROR: Could not save data to /opt/myapp/data.txt, permission denied

Your error messages need to be as helpful as possible. They are born to say "______ went wrong, and here's how you make it stop _____". You may not be able to depend on being able to surface logs directly, but you can always be sure to throw readable exceptions. It's a good idea to create your own exception classes, check out this example from SQLAlchemy (full code).

class SQLAlchemyError(Exception):
     """Generic error class."""
class DisconnectionError(SQLAlchemyError):
     """A disconnect is detected on a raw DB-API connection.
     This error is raised and consumed internally by a connection
     pool. It can be raised by the :meth:`.PoolEvents.checkout`
     event so that the host pool forces a retry; the exception will
     be caught three times in a row before the pool gives up
     and raises :class:`~sqlalchemy.exc.InvalidRequestError`
     regarding the connection attempt."""

Having a top-level class for all SQLAlchemy's exception classes makes it easy to see if a problem comes from SQLAlchemy with an issubclass test. For users, this makes it easy to track down the source of a problem.
Specific exceptions like DisconnectionError help by explaining everything SQLAlchemy tried before raising the exception.

Wrapping Up

Next time you sit down to write a library, don't start by writing code. Get out of the author mindset for a moment and think about how you'd expect it to work. Consider which features you'd need, and which are "nice-to-have". Look at libraries that solve similar problems and see what idioms they use, or what they do that doesn't seem quite right.
Take the time to solve the problem you set out to in the best way you know how. Your users and fellow developers will thank you.