Skip to content

Instantly share code, notes, and snippets.

View joetechem's full-sized avatar
💭
Focusing on Cloud Arch responsibilities

joe joetechem

💭
Focusing on Cloud Arch responsibilities
View GitHub Profile
@joetechem
joetechem / Python_List_Intro.py
Last active October 21, 2016 21:42
Python_List_Intro.py
# This program shows the difference between a strings and lists
# with a quick introduction to using functions with a list
# This is my typical grocery list stored as one single STRING
grocery_list_for_Joe = ['eggs, milk, dandruff shampoo, holy grail, 2 african swallows, coconut']
#print(grocery_list_for_Joe)
# Below is my grocery list created as a LIST instead of a STRING:
@joetechem
joetechem / make_your_grocery_list.py
Created October 21, 2016 20:20
make_your_grocery_list.py
# a program to make your own grocery list
# What happens: python asks for a few items and their prices to be put into a grocery list
# this program shows functions, comments, varaiables, user input and FLOAT
print("give me a food product you want in your grocery list")
food = raw_input()
#foodp = int(input('enter food foodp = int(input('enter food pric: '))
#print("what is the price of that food?")
#food_price = raw_input()
@joetechem
joetechem / if_elif.py
Created November 2, 2016 21:32
You are a tree condition statements
# If and Elif Statements
print("You are a tree.")
print("Tree, what is your name?")
tree_name = input()
print(tree_name + ", how old are you?")
tree_age = float(input())
if tree_age > 112:
print(tree_name + ", you are an old tree!")
elif tree_age < 112:
print(tree_name + ", do some more growing!")
@joetechem
joetechem / turtle_module_loop
Created November 2, 2016 21:52
For_Loop_Turtle
for i in range(4):
t.forward(100) # notice the indentation
t.left(90)
# VERSUS
for i in range(4):
t.forward(100) # notice the lack of indentation here
t.left(90)
@joetechem
joetechem / commands.py
Created November 3, 2016 16:11
commands.py
# coding: utf-8
print("type command: hello")
COMMAND1 = "hello"
def handle_command(command):
"""
Determine if the command is valid. If so, take action and return
a response, if neccessary.
"""
@joetechem
joetechem / command_respond.py
Created November 3, 2016 16:12
command_respond.py
# coding: utf-8
# A simple command-respond program
# Python asks for input then carries out the specified action base don the condtions of the input
#COMMAND1 = "hello"
#def handle_command(command):
# response = ""
@joetechem
joetechem / tuples-maps-intro.py
Created November 10, 2016 17:55
Comparing lists, tuples and maps
# a crude program to show examples of a tuple
# and relate to lists and strings
# a tuple is similar to a list, but uses parentheses
fibs = (0, 1, 1, 2, 3)
print(fibs[3])
# Above, we define the variable fibs as the numbers 0, 1, 1, 2, and 3.
# Just like a list, we print the item in the index position 3 in the tuple.
@joetechem
joetechem / simple-command-response.py
Last active September 18, 2017 18:38
command response loop python program
# SiliconValleyOfTheSouth
# Original Program by Wray at Tech Em Studios
# Put your commands here
# Keep the values lowercase
COMMAND1 = "what?"
# Your handling code goes in this function
def handle_command(command):
"""
@joetechem
joetechem / Mtn_Secenario_Adventure_Game.py
Last active July 3, 2021 04:07
Mtn_Secenario_Adventure_Game.py
# Choose your own adventure game
# WIZARD MOUNTAIN
# a text-based choose your own adventure game
# This adventure is like an upside down tree with branches
# this program is full of blocks of code, known as branches, or code branches
# Make sure to visit every branch to make sure all of the code works
def parachute_fail():
@joetechem
joetechem / techem
Last active November 29, 2016 01:00
script to run for chbooks
#! /usr/local/bin/bash
apt-get --assume-yes install matplotlib
apt-get --assume-yes install idle
apt-get --assume-yes install git
apt-get --assume-yes install python-setuptools
apt-get --assume-yes install python-dev
apt-get --assume-yes install build-essential
easy_install pip
apt-get --assume-yes install git-cola