Skip to content

Instantly share code, notes, and snippets.

@ejaramos
ejaramos / pets.py
Created June 24, 2020 23:44 — forked from jhamrick/pets.py
Demonstration of python classes and inheritance.
class Pet(object):
def __init__(self, name, species):
self.name = name
self.species = species
def getName(self):
return self.name
def getSpecies(self):
@ejaramos
ejaramos / pyscript.py
Created June 24, 2020 23:36 — forked from nhoffman/pyscript.py
Python script template
#!/usr/bin/env python
"""A simple python script template.
"""
from __future__ import print_function
import os
import sys
import argparse
@ejaramos
ejaramos / calculate_combinations.py
Created September 30, 2017 06:00 — forked from anonymous/calculate_combinations.py
calculate_combinations created by ejr - https://repl.it/Lo5T/27
'''
Write a function that given an input set of integers with 4 entries and a desired
target sum, returns the set of combinations of any length that add up to that target sum.
Each set of combinations must be specified by the indexes (0-based) of the integers.
Assumptions:
- range for elements_of_list: range(0,10e6)
- elements can repeat, and do not have to be sorted
'''