Skip to content

Instantly share code, notes, and snippets.

Intro

Programming is my favorite thing

Who has programmed before?

Computers do exactly what you tell them to do if you can program you can do almost anything

Syntax matters - computers are very particular about how they understand things

https://goo.gl/ulOqGU

Key Concepts

Sequence

Decision

Repetition

Objects

Methods

Attributes

Variable

functions + arguments

import turtle
def drawPolygon (the_turtle,num_side):
angle = 360 / num_side
for iter in range (num_side):
are_we_fizz = iter + 1
print are_we_fizz
if are_we_fizz % 3 == 0 and are_we_fizz % 5 == 0:
the_turtle.color('blue')
import turtle
def get_user_input():
userInput = raw_input("How many sides does your shape have?")
try:
userInput = int(userInput)
except:
print "Hey that's not a number!"
import turtle
def get_user_input():
userInput = raw_input("What trick do you want to do?")
try:
userInput = str(userInput)
except:
print "That's not a trick!"
import turtle
import random
def main():
turtle1 = turtle.Turtle()
turtle2 = turtle.Turtle()
turtle3 = turtle.Turtle()
turtle4 = turtle.Turtle()
turtle1_distance = random.randrange(100)

Cheat Sheet

Variables

Variables are just boxes that you can put other things into. You can put numbers, words, other variables, and any value you can think of inside a variable. A variable is a box for stuff!

Today we will be working only with strings and ints.

@sahilsinha
sahilsinha / 00_GraphQL_Subscriptions.md
Created November 11, 2021 23:11 — forked from tricoder42/00_GraphQL_Subscriptions.md
GraphQL Subscriptions with django-channels

GraphQL Subscription with django-channels

Django channels are official way for implementing async messaging in Django.

The primary caveat when working with GraphQL subscription is that we can't serialize message before broadcasting it to Group of subscribers. Each subscriber might use different GraphQL query so we don't know how to serialize instance in advance.

See related issue