-
Notifications
You must be signed in to change notification settings - Fork 0
Roadmap to Learning Python
Below is a long read, but it assumes you know nothing - skip as you need to.
This educational exploration into Python is NOT designed to be your very first introduction into coding. Don’t worry - it’s still very beginner material (and we progress onto intermediate topics), but there is work you will need to complete BEFORE watching the first video.
This will get difficult, fast. Do not be alarmed. I’m jumping across skill levels between videos, but the idea is I’m here to answer any questions you may have. Also, I always choose a project that’s extensible - meaning you can expand upon what we’ve done as practice!
I’m not perfect. It is likely that you may be able to improve upon the code that I write. Feel free to do so and share!
- Install the Windows Management Framework
NOTE: You need to install the whole thing to gain access to PowerShell. Whenever I say CLI, this is what I am referring to for Windows users. - Follow the instructions in this video, ignoring everything about atom.io.
- Make sure you have Xcode installed! If you don’t, get it - it’s free.
- Get Homebrew - it's free, too.
- Open a new terminal after install
- Type and enter:
brew install python
- Type and enter:
brew install python3
- Common, modern Linux distros will likely already have Python 2 and 3 installed by default.
- You can check this by running the following commands in your terminal:
-
$ python --version
should yield Python 2.7.13 -
$ python3 --version
should yield something like Python 3.6.x
-
- If you didn’t see the expected feedback, your situation may be remedied by running:
$ sudo apt-get update
$ sudo apt-get upgrade
-
$ sudo apt install python[3]
NOTE: Replace with your distribution's package manager, such as <yum, dnf, zypper, pacman...> and so on.
Regardless of your operating system, you can confirm installation of Python 3.6.x by typing and entering python3 -V
and python -V
in your CLI (Command Line Interface).
You should see Python 3.6.# and Python 2.7.13 respectively.
Your platform is ready to handle Python locally (on your own computer)! Wooo!
Now go to CS Circles from University of Waterloo, and complete their Python course. It may take you a good chunk of time to complete it, but it’s how I learned Python - it’s simple, it makes sense, and you don’t need to install anything except a browser (and you probably already have that). If you’d like an alternative to CS Circles, you can try http://learnpython.org/!
When you’re done with CS Circles, I recommend that you download VS Code (Windows), Sublime Text (Mac), or Atom (Any OS) and - depending on your operating system - Google "run python in terminal " and see how you can run a program that you write! This is a more interesting and dynamic topic that a simple write-up can’t handle, so feel free to ask the Python channel on our Slack team for help.
TL;DR
- Install Python
- Learn Python syntax with CS Circles or LearnPython.org
- Download and Install a code editor
- Learn how to run Python programs with your command line interface
Done? NOW, we’re ready to go…
Lesson (links to video)
- High-level overview of Python
- Code-along: Rock, Paper, Scissors
- Practice: Create other command line games!
Lesson (links to video)
- PEP8 documentation (10 minute task)
- Classes and Modules (15 minute task)
- Improve Your Python: Classes and OOP (>60 minute task)
- A deeper glance into Python’s internals
- Object-Oriented Programming
- Software Engineering Design Patterns
- Practice: Expand upon the strategy pattern!
Lesson (links to video)
Space- and Time-Complexity in Code Code-along: Actual Interview Question!
HackerRank.com CodeWars.com CodeFights.com LeetCode.com
Khan Academy is doing the best they can to make the language simple. There’s a lot of jargon going into it, but please at least skim it and then ask questions.
I’ve said before that code is only good if it’s readable, fast, and small. Readability is subjective and it has been discussed it at length, but there’s actually a science behind determining how quick and lightweight your code is. The concept of measuring the size of your code is called “Space-Complexity” and the concept of measuring its speed is called “Time-Complexity”.
Big-O means “at least” Big-Theta means “on average” Big-Omega means “at most”
Usually, we measure both time- and space-complexity with regards to the worst-case scenario. For example, if we have a function that simply iterates through a for loop of a list, we would say the the solution runs in O(n) time. In other words, a for loop takes at least n computation-times to complete (n being the size of the list).
It is a little more complex, but consider every for loop or while loop to be n in size. If we have a loop within a loop, were doing n operations n times so the code would be O(n^2)
time. If we were able to solve a problem without a loop, it’d likely be O(1)
aka “Constant time” - this is the best case scenario in time- and space-complexity. If we were able to solve a problem with just one loop, it’d likely be O(n)
aka “Linear Time” - this is widely regarded as a good solution. Other common complexities are O(nlogn)
and O(logn)
- http://bigocheatsheet.com/