Wizarding Code

If you are just getting into coding or want to brush up your skills, here is a collection of courses I have put together for various audiences. If you enjoy the content, please drop me a line and let me know.

In this class we will learn Python with a magical wizard and witch theme. We will start from the basics and build up an impressive list of programming skills over the course. We will discuss methods and topics in programming and actually build programs ourselves like the sorting hat, spell casting, and many other games. This is a great introduction to programming for muggles and wizards alike, and a fun and interactive way to demystify programming with fun examples. Math will be kept to a minimum, and focus on variables like school houses, spells, wands, points against the dark arts, so students learn math concepts without the numbers along the way. 

In this course, we will learn how to program in python from the ground up. Each module will have an in-depth video explaining the concepts and working through building programs and examples of concepts. From the very beginning steps into programming (the basics of python) to more complicated programs, we will build up the skills to make our own programs and learn to code. Weekly modules will cover different topics, and scaffold skills so we are able to build more complex programs and think of new ways to solve coding challenges. Students are encouraged to submit the weekly homework to the class, review and play the games and programs we build, and learn and discuss as we go. 

Each module will have an overview of the topic we are going to cover, activities and games to learn, build on, and reinforce concepts. We will cover the basics of programming, learn about variables, and ways to store and use information in lists, dictionaries, tuples, and other structures. We will also learn about conditional statements to sort data, and user input and loops. The course will focus on fun and interesting examples to help students understand concepts that can be applied elsewhere.

Because this is a flex class, students will get detailed videos each week that cover the topic of the week, as well as handouts or PowerPoint slides that cover the topic.

Course modules will cover:

Module 1: Introduction to Python

We will talk about variables, and work on programs to explore variables, strings, integers, and floats. We will also build a dog age calculator and work on different ways to join and print strings.

Module 2: Lists

We will do a deep dive into the world of lists and build programs that draw from lists including a changing story based on random selections from the contents of lists.

Module 3: Loops

Our first examination of for loops and the ways we can use them with variables and lists to make things run over and over again without needed extra lines of code. 

Module 4: Conditional Statements

Conditional statements will let us sort though data, and we will use if/elif/else statements to sort through data, play a game against the computer, and organize our data by condition

Module 5: Dictionaires 

Once we have covered the basics, we will work on the next data type in python, dictionaries. These let us store more complex kinds of data, and organize our code in key and value pairs. We will also talk about OOP or Object Oriented Programming and JSON

Module 6: User Input and While Loops

Up until now we have been writing programs that we supply the data for, now we will learn new methods for users to supply data. This can be used to build chatbots, customize our programs, and collect user input. We will also talk about our second type of loop, while loops which run based on a condition.

Module 7: Functions

In module 7 we will learn how to create our own functions and build programs by connecting files and functions together.

Module 8: Text Based Game

Using the many topics we have covered to this point, we will build a text based game using functions, variables, and a game map. We will discuss how to create pathways for players to follow, and use their input to navigate the game. 

Module 9: Text Based Game Part 2

We will continue working on our games, and programming additional interactive and random elements to make them more fun and exciting.

Module 10: Connecting to an API

In this module, we will connect to the weather and space API (application programming interface) so our programs will use live data to run. This means we can build some really neat programs that use live data.

Module 11: More APIs

We will continue our API adventure with additional Space data and build a program that predicts where the International Space Station is. We will also program a URL with strings, so we can generate web links to google maps that visualize the data we capture in the API. 

Module 12: Turtle, Final Wrap-up and Beyond 

In our final module, we will work on some other neat things Python can do, like turtle, to create graphics and images. We will also work on creating graphs from some of our data, and reviewing what we covered in the course and how topics connect together.

Let's get started!

Module 1

Hello and welcome everyone! I am excited to get this class going!

Just like a Patronus, in this module we are going to learn how to

program  (conjure?) several interesting examples of using code and

learn how to use variables to convert strings, numbers, and build some

fun programs.

Harry Potter: "And how do you conjure it?"

Remus Lupin: "With an incantation, which will work only if you are

concentrating, with all your might, on a single, very happy memory."

Before getting started:

Here is a video showing how to use the code we create each week and

use it to make your own awesome programs!

- Its a good idea to make an account on repl.it, as I will send back

code using this platform.

- Its probably best to use repl.it or pythonanywhere.com to get

started. If you are using PythonAnywhere, a free account works, just

remember to close consoles from the main screen

- Wherever you code, the file always needs to end in .py

Options to use python in the cloud or on the computer:

https://youtu.be/1zsoNr9MyBI

In the videos in this series, I use Geany (https://www.geany.org/ ),

Sublime Text (https://www.sublimetext.com/ ), and of course Python

(https://www.python.org/ ) on the computer. Python needs to be

installed first. These will work for both Mac and PC.

If you are on a Mac, there are two videos to help you get started with

Geany and Sublime Text:

https://www.youtube.com/watch?v=f4XvafEul7g

https://www.youtube.com/watch?v=WMB4yOb7kiA

To get started without installing anything (for example on a

Chromebook), you can use Python Anywhere

(https://www.pythonanywhere.com/ ), replit (https://repl.it/~ and open

a new Python replit). However you code, it should all be the same

thing, just make sure you are in Python 3.

If you have any questions, just let me know. Remember python files

always end in .py

Module 1 files and slides:

https://ln.sync.com/dl/03f41df90/dkvjurvn-rg2kqsdv-q6egaqik-vkzmcjbf

Module 2

Hi everyone! In this module, we explore lists and see how to store

more than one piece of information at a time. Remember that with

variables, they keep overwriting each other, but with lists, we can do

some neat things to store more than one thing at a time. Check out the

game at the end, and make your own. We also discuss assignment,

equality, and how to move things in and out of lists, a great way to

"pick up" items and points in games and programs! Review the video and

slides, and send in your ever changing story to the classroom!

Slides and code:

https://ln.sync.com/dl/24d1160c0/ppxcgiip-ehz83p7g-mt9af4av-6iu7b9pu

Module 3

Hi everyone! In this module, we will look at lists and loops. We will

use the elements in a list and loop though them using a for loop. We

will also talk about some numbers, stats, and a whole lot more. Check

out the slides and files for this module, and I hope you have a lot of

fun working through it with me as we go!

Slides and code:

https://ln.sync.com/dl/f3996dec0/umk6zpwt-8rgw6fg2-i7yndxjs-c7gtqcau

Module 4

In this module, we will explore if statements and equality, and play a

whole bunch of games, both old and new. Check out the sorting hat and

muggle madness, and a new program called hoot which lets you make a

version of the OWLs. In this module we will look at equality, if

statements, and new ways to check if things are inside of lists.

Slides and code:

https://ln.sync.com/dl/549919f00/vdghui3j-7zrhntj9-rmmawg6a-bpaamjye

Module 5

In this module, we are going to explore Python dictionaries.

Dictionaries are data structures that hold key value pairs and use { }

brackets instead of [ ] brackets like a list. In this module we will

look at how to create, store, change and use dictionaries to store key

value pairs. This is going to make it a lot easier to write

sophisticated programs later on and use internet data. We are also

going to explore loops for dictionaries, which are similar to loops

with a list.

Slides and code:

https://ln.sync.com/dl/1e88e7330/mkfg6sc2-z7sveuwk-ndbna28j-ka92q8zv

Module 6

In this module we talk about user input and while loops. We look at a

few different examples of how to store user input and convert it from

a string (even if you type in numbers, they come in as a string) to an

integer, if you want to use the numbers to do math in the program. We

also build a number guessing game using these principles.

Slides and code:

https://ln.sync.com/dl/671409d00/mhvxugyz-e6m3q7x4-igr6grhx-ws72dzua

Module 7

Welcome to Module 7! In this modules we are going to explore functions

and look at different ways to use blocks of code we can use again and

again. These blocks are very important, because they are the basis of

our games over the following two weeks when we start working on our

text based games and do some really amazing coding.

Files and slides:

https://ln.sync.com/dl/7c296aaf0/6ww5hkun-saqrs8kn-82ay38ca-89i4a5x4

Module 8

Welcome to Module 8! In this module we are going to expand what we

covered with functions to look at how to build a game with functions

and a boolean flag. In this module, I start a game from scratch, use a

game map, and code each room (function). At times it does not work,

but learning from your mistakes is a major part of coding. :) I think

the end result works pretty well, and is a good starting point for a

more complex game. This module is a little long, so many break it up

into a couple sessions and take some time to play at different games

and see how they work. We will start off with a detailed overview of A

Journey of Options next class and see how the game is constructed.

If you are looking for something a little shorter with a less complex

game, I have added a second video that goes through the other code in

this module in about half the time. You can watch one or both, and use

them to work through the code in this module.

Module 8 files:

https://ln.sync.com/dl/e053684f0/3fd4bkrr-qg836kvg-j84dp75d-j2a6rwq7

Module 9

Welcome to Module 9, the second of our game classes! In this module we

look at many new and different games. We go through games that use

loops, functions, and even API (Application Programming Interfaces)

that use live internet data to work. We will get more into connected

data next week, but for this week we will look at how to improve our

games, add mini games into them, use the clear() function to do

animation, and more! I think these tools can be a lot of fun, and used

to improve and expand what you have been working on.

Module 9 files:

https://ln.sync.com/dl/db49da260/rtcagvr7-bvewjas7-cshsfcrq-qasp2kyv

Module 10

Welcome to Module 10, the first of two exciting explorations of

connected data! In this module, we will use APIs (or Application

Programming Interfaces) to gather live data and build programs that

use real time data from the internet. In this module, we will gather

data from the Space Station, download cats, ask Hermonie advice, HP

trivia, and many more interesting programs. I mentioned two sites that

have lists of free APIs, check out

https://apilist.fun/collection/help-fix-the-climate and

https://github.com/public-apis/public-apis there are many more JSON

APIs out there, and understanding how to connect with and use data

means you can connect to pretty much any kind of data.


Module 10 files:

https://ln2.sync.com/dl/81f6bc5c0/fkr6gyf4-rqs9pvhq-8w8ahck9-vsjhh8b8

Module 11

Welcome to Module 11, the second half of our API exploration. This

this class we are going to look at many different kinds of APIs and

look at some code. From the http://www.datamuse.com/api/ rhyming API

to the dog API https://thedogapi.com/ and many games, we look at how

live data allows us to build many neat programs. In this module we

also explore the OMDB movie API http://www.omdbapi.com/ and

http://apimeme.com/ which we use to build our own custom memes.

Whichever API we use, we can build programs that go beyond what we

start with (like the trivia game), where we build the structure of the

program and the live data makes our game new and exciting.

Module 11 files:

https://ln2.sync.com/dl/2b2678e40/6y7wcf89-kmpv2ngr-q8qt6cb2-hipdfnb4

Module 12

Welcome to Module 12, Turtle (and more)! You made it to the end of the

course, way to go! I hope you learned a lot of Python and had a lot of

fun! There is so much that you can do with what you have already

learned, and so many more amazing things you can do with Python!

There are four pieces of code for this module, all of them on repl.it :

Turtle Drawing:

https://repl.it/@SidneyShapiro/Bob-the-turtle

Text to speech:

https://repl.it/@SidneyShapiro/text2speech

ASCII Fire!

https://repl.it/@SidneyShapiro/PreviousDimInstitute

ASCII Kaleidoscope:

https://repl.it/@SidneyShapiro/QueasyPromotedSweepsoftware