Part 1: Introduction to Python

Part 1 is now called “Python Basics: A Practical Introduction to Python 3” and it is a free upgrade for you and this is the version of the book you should be working with. We’ve updated the lessons to use Python 3.9, rewrote many parts of the book entirely, and added additional bonus resources such as online quizzes and new exercises.

Download Book Files

You can access this book in different file formats that are optimized to give you a great reading experience, no matter which device you are using. The options are as follows:

DRM-free PDF optimized for reading on tablets and computers:

Download

Python Basics (PDF)

5.8 MB

ePub version for e-reader devices and phones/tablets:

Download

Python Basics (ePub)

3.8 MB

Mobipocket (.mobi) version for reading on Kindle devices:

Changelog

Locked learning resources

Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Already a member? Sign-In

Locked learning resources

The full lesson is for members only. Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Already a member? Sign-In

Avatar image for asyhariachmadichsan

asyhariachmadichsan on Jan. 9, 2020

Hi, thank you for creating such amazing product!

I just purchased and downloaded the 3 e-book files and skimmed through it. And I saw the Django version used throughout the course is 1.10. Do you have any planning to update Part 2 and Part 3 of the course?

Thank You!

Regards,

Ichsan

Avatar image for Dan Bader

Dan Bader RP Team on Jan. 9, 2020

Hi Ichsan, we’re planning to release updates for part 2 and 3 of the course at some point once the final version of part 1 (Python Basics) has been completed :)

Avatar image for Andreas

Andreas on May 11, 2020

Just quick UI/UX Feedback. I was trying to bookmark this page, and was getting frustrated when I noticed the “Mark Completed” and the “Bookmark action” are right next to each other - which made be believe that hitting the “Bookmark” would cause this to be marked completed. That make sense? I think the “bookmark” and “marked completed” should be separated by whitespace .... just my $0.02

Avatar image for pchegoor

pchegoor on July 24, 2020

When will the FINAL version of this Ebook release?

Avatar image for Ernie White

Ernie White on Sept. 17, 2020

On page 17 is the following code:

import requests
resp = requests.get("http://olympus.realpython.com") 
html = resp.text
print(html[86:132])

Running that code I get the following

Traceback (most recent call last):
  File "hello.py", line 2, in <module>
    resp = requests.get("http://olympus.realpython.com")
  File "/Users/user/python-course/env/lib/python3.8/site-packages/requests/api.py", line 76, in get
    return request('get', url, params=params, **kwargs)
  File "/Users/user/python-course/env/lib/python3.8/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Users/user/python-course/env/lib/python3.8/site-packages/requests/sessions.py", line 530, in request
    resp = self.send(prep, **send_kwargs)
  File "/Users/user/python-course/env/lib/python3.8/site-packages/requests/sessions.py", line 643, in send
    r = adapter.send(request, **kwargs)
  File "/Users/user/python-course/env/lib/python3.8/site-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='olympus.realpython.com', port=80): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd17dc711c0>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'))
Avatar image for Bartosz Zaczyński

Bartosz Zaczyński RP Team on Sept. 17, 2020

Python can’t make a network connection to a non-existent resource. It might have existed in the past, or maybe it was used as an imaginary example.

Anyway, if you copy and paste that URL to your web browser’s address bar, it’ll tell you that this site can’t be reached.

You can also try to ping the hostname from the terminal to confirm:

$ ping olympus.realpython.com
ping: olympus.realpython.com: Name or service not known

In other words, there’s no known IP address behind such a domain name.

Avatar image for Dan Bader

Dan Bader RP Team on Sept. 17, 2020

The correct URL for the Mount Olympus example should be olympus.realpython.org (.org instead of .com)

Avatar image for Dan Bader

Dan Bader RP Team on Sept. 17, 2020

Aaand we just corrected it in the book as well, thanks! :)

Avatar image for eawongtheprogrammer

eawongtheprogrammer on Oct. 6, 2020

Congratulations on leaving early access for book 1, Python Basics.

I saw that there are real examples updated in book 1 after version 3.9 release

Sample Projects and Code Challenges showing you how to build fun & rewarding example projects using your newfound Python skills. All challenges and exercises come with full sample (solution) code so you can check your own implementation against them. Here are some of the Python projects you’ll build: Stock investment tracker

I would like to jump straight to Stock investment tracker, where can I find it in the book?

Avatar image for Dom

Dom on Feb. 8, 2021

Hi, I am not sure if this is the correct place to ask.

I am currently going through Part 1: Introduction to Python. In Challenge 9.4, there seems to be an error with the median() function. The computation for the median for when the number of items is odd seems to be wrong. Can I confirm this?

You must own this product to join the conversation.