Instantly share code, notes, and snippets.

# sahilsinha

• Sort options
Last active Oct 3, 2017
View Lesson1.org

## 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.

Created Dec 9, 2015
View race.py
 import turtle import random def main(): turtle1 = turtle.Turtle() turtle2 = turtle.Turtle() turtle3 = turtle.Turtle() turtle4 = turtle.Turtle() turtle1_distance = random.randrange(100)
Created Dec 9, 2015
View turtletricks.py
 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!"
Created Dec 9, 2015
View polygon.py
 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!"
Created Dec 9, 2015
View fizzbuzz.py
 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')
Last active Dec 9, 2015
View pythonturtle2.org

https://goo.gl/ulOqGU

# Key Concepts

## functions + arguments

Last active Dec 2, 2015
View pythonturtle.org

# 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

You can’t perform that action at this time.