Skip to content

Instantly share code, notes, and snippets.

View jordanhudgens's full-sized avatar

Jordan Hudgens jordanhudgens

View GitHub Profile
class Invoice:
def __init__(self, client, total):
self._client = client
self._total = total
def formatter(self):
return f'{self._client} owes: ${self._total}'
@property
class Invoice:
def greeting(self):
return 'Hi there'
inv_one = Invoice()
print(inv_one.greeting())
class Invoice:
def __init__(self, client, total):
self.client = client
self.total = total
def formatter(self):
return f'{self.client} owes: ${self.total}'
google = Invoice('Google', 100)
class Calculator(object):
def add(self, x, y):
return x + y
import unittest
import calculator as c
class TddInPythonExample(unittest.TestCase):
def test_calculator_add_method_returns_correct_result(self):
calc = c.Calculator()
result = calc.add(2,2)
self.assertEqual(4, result)
Creating a virtualenv for this project…
Using /Users/admin/.pyenv/versions/3.6.3/bin/python3 to create virtualenv…
⠋Running virtualenv with interpreter /Users/admin/.pyenv/versions/3.6.3/bin/python3
Using base prefix '/Users/admin/.pyenv/versions/3.6.3'
New python executable in /Users/admin/.local/share/virtualenvs/python-env-Fa5mmZ2G/bin/python3
var guess = prompt("Guess a number 1-5");
var num1 = "1";
var num2 = "2";
var num3 = "3";
var num4 = "4";
var num5 = "5";
var num6 = "";
var num7 = numberRange(6, 51);
function numberRange(start, end) {
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='UTF-8'>
<title></title>
<style>
img {
width: 400px;
}
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='UTF-8'>
<title></title>
<style>
.hideElement {
visibility: hidden;
}
var ready, set_positions;
ready = void 0;
set_positions = void 0;
set_positions = function() {
$('.card').each(function(i) {
$(this).attr('data-pos', i + 1);
});