DEV Community

loading...
Cover image for Learn Python Interactively with These 5 Tutorials
Next Tech

Learn Python Interactively with These 5 Tutorials

scosta profile image Saul Costa Originally published at next.tech ・3 min read

This post walks you through how to launch an online coding environment and then covers 5 tutorials for learning various Python skills. You can use your sandbox alongside these tutorials so you can learn by doing as you read!

Let's get started!


Setup

To get started, launch a Python sandbox on Next Tech by clicking here.

Then pick one of the sites from the list below, for example, Google's Python Class.

That link skips the install section of the class entirely, since your sandbox already has Python installed!

This tutorial says you can use an interactive command line (launch by typing python into your sandbox terminal) OR a file with Python code in it. To do the latter, just create a file in your sandbox (e.g. main.py) and put your code in there. Click the blue Run button to execute your program.

As you read through the tutorial, you can click the copy icon in the top right of each code box to copy the code to your clipboard. Then, back in your sandbox, paste the code into your editor or command line.

While the other tutorials may differ slightly, they all follow this general idea: take the code in the tutorial, and run it inside your sandbox. Let's take a look at all the tutorials!


#1: Google's Python Class

Google's Python Class is free and designed for people with some programming experience (i.e. know what a "variable" or "if statement" is) and want to learn Python. The class is actually used inside Google to introduce people to Python!

The class includes:

  • Written tutorials
  • Videos
  • Code exercises

The class starts with basic Python concepts like strings and lists, working towards full programs that cover text files, processes, and http connections.


#2: The Official Python Tutorial

The Official Python Tutorial is provided by the Python Software Foundation that is the creator of the Python programming language.

While the tutorial claims to not attempt to cover every single feature, it is extremely in-depth, and covers the following topics:

  • An introduction to Python
  • Program control flow
  • Data structures
  • Modules
  • Input and output
  • Errors and exceptions
  • Classes
  • Some of the Python standard libraries

After reading it, you will be able to read and write Python modules and programs and will be ready to learn more about the various Python library modules described in The Python Standard Library.


#3: Official Flask Tutorial

Flask is a Python microframework used for creating web applications. Their official tutorial covers:

  • Project layout
  • Application setup
  • Database integration
  • Blueprints, views, and templates
  • Static files

...and quite a bit more!

The tutorial walks you through creating a basic blog application called Flaskr. Once completed, users of the application will be able to register, log in, create posts, and edit or delete their own posts.

You should have at least some basic Python knowledge to get started with this tutorial.


#4: Introduction to Python Generators

In Python, generators are functions that can be stopped and started on demand, returning an object that can be iterated over later. Unlike lists, they are "lazy" and produce (or "generate") items one at a time and only when necessary. This makes them much more memory efficient when dealing with large amounts of data.

This tutorial details how to create generators and expressions and when and why you might use them.


#5: Stripe's Python Integration

Stripe is the leading payment processing platform and makes it easy for developers to integrate payment processing into their application. Stripe's official documentation walks you through how to use their API using Python. It includes:

  • Using a REST API
  • API authentication
  • API error handling
  • API pagination
  • All Stripe API endpoints

While this isn't a proper tutorial, it does a great job of walking you through how to explore the Stripe API using Python. Be sure to select Python when you load the page!


Summary

In this post we've covered 5 tutorials and guides you can use with a Python sandbox. I hope it's been useful! If you have ideas for other tutorials to include, just drop us a note below!

Discussion (0)

pic
Editor guide