Python

December 10, 2022 · View on GitHub

Learning Python (Courses)

NameDescription
Introduction To Python ProgrammingFree, Udemy
Python for BeginnerFree, Udemy
Learn PythonFree, freeCodeCamp
Learn Python from ScratchFree, educative.io

Learning Python (Tutorials and Interactive platforms)

NameDescription
HackerRankPython challenges/exercises
LeetCodePython challenges/exercises
ExercismPython challenges/exercises
py4ePython lessons and materials
W3 PythonPython tutorial
Mode Python TutorialPython Tutorial
Khan AcademyPython courses and lessons
Python resources for everybodyPython written resources

Modules

NameDescription
subprocessSpawn new processes (=execute commands).
agithubRest API client for rapid prototyping on any rest API.

Books

AuthorTitleComments
Jeff KnuppWriting Idiomatic Python 3.3
Dane HillardPublishing Python Packages
Yong CuiPython How-To
Pael AnniLet's Talk Python)

Articles, Tutorials & Blog Posts

AuthorArticleLevelComments
Megha MohanMutable vs Immutable Objects in PythonBeginner
Kenneth ReitzThe Hitchhiker’s Guide to Python
Kenneth ReitzSerialization

Libraries, Frameworks & Tools

NameDescription
Natural Language ToolkitPlatform for language processing programming
FlaskWeb microframework based on Werkzeug, Jinja 2
DjangoWeb framework with batteries included
MypyStatic type checker
Pandas"open source data analysis and manipulation tool"

Cheat Sheet

YAML

  • Read YAML
with open(r'/file/path') as file:

Files

  • Read remote file(s)
from fabric import Connection

with Connection(host) as conn:
    with conn.sftp().open(path) as stream:
    ...

Dictionaries

  • Define dictionary: some_dict = {'first_number': 2017, 'second_number': 2022}
  • Add item to dictionary: some_dict['third_number'] = 1991
  • Remove last item: some_dict.popitem()
  • Remove item by key: some_dict.pop("third_number")
  • Get all keys without values: some_dict.keys()
  • Get all values without keys: some_dict.values()
  • Access item: some_dict['first_number'] or some_dict.get('second_number')
  • Number of items in the dictionary: len(some_dict)
  • Update value of a certain key: `some_dict.update({"first_number": 02017})

Python Checklist


Checklist

  • Data Types

    • Numbers (int, long, float, complex)
    • List
    • Dictionary
    • String
    • Tuple
  • Mutability

    • What data types are mutable?
    • What data types are immutable?
  • PEP8

    • What is it?
    • Give an example of three coding conventions Python developers should always follow
  • Errors & Exceptions

    • How do you handle exceptions?
  • Iterators

    • What 'enumerate' is used for?
  • List Comprehensions

    • Is it better than for loop? If yes, why?
    • How to perform list comprehensions for nested lists?
  • Data serialization [ ] How you do with Python?

  • Type Annotations

  • Dataclass

  • What's that?

    • What _ is used for in Python?
  • Meta-programming

  • Descriptors

  • Decorators

[ ] Context Managers

  • Buffering Protocol