Giter Site home page Giter Site logo

yanghaha11514 / harry_potter_universe Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zotroneneis/magical_universe

0.0 1.0 0.0 99 KB

Awesome Python features explained using the world of Harry Potter

Home Page: http://alpopkes.com/year-archive/

Python 100.00%

harry_potter_universe's Introduction

Awesome Python Features Explained Using Harry Potter

As outlined in my blog post, I decided to take on a new habit using a technique I found on the 'get disciplined' subreddit.

As one of my new habits I chose: "Code for 15 minutes every day". As part of the habit I've started creating a series of blog posts on important and awesome Python features, including object oriented programming, properties, function annotations, duck typing, etc.

Since I was bored by the usual tutorial examples, I looked for a topic that would make it fun to study and implement the concepts. And since I absolutely love Harry Potter, I started creating a whole Harry Potter universe around the topics. So if you like Harry Potter and want to improve your Python knowledge and skills (and maybe also your Harry Potter knowledge), get right into it!

A logbook of what I worked on each day can be found on my website.

The code runs in Python 3.6, the code on data classes requires Python 3.7 (or you pip install data classes for Python 3.6).

Start date: 07/23/2018

Overview

Day Topics Blog post with explanations Code for the day
1 Intro to object oriented programming, classes, inheritance Day 1 Code day 1
2 Class methods, instance methods, static methods, using class methods as alternative constructors Day 2 Code day 2
3 Function annotations Day 3 Code day 3
4 To-string conversion, __repr__, __str__ Day 4 Code day 4
5 Decorators Day 5 No new code added
6 Properties, @property and property(), setters, getters Day 6 Code day 6
7 Underscore patterns for variable naming, _variable, __variable, __variable__, etc. Day 7 No new code added
8 New methods and classes added to the HP universe Day 8 Code day 8
9 Duck typing, EAFP principle Day 9 Code day 9
10 & 11 Namedtuples Day 10 & 11 Code day 10 & 11
12 - 15 Abstract Base Classes Day 12 to 15 Code day 12 to 15
16 - 18 Data Classes Day 16 to 18 Code day 16 to 18

Feedback

In case you find a mistake in the code or the blog posts, please let me know by opening an issue!

harry_potter_universe's People

Contributors

zotroneneis avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.